1 | /* -*- C++ -*- |
---|
2 | * |
---|
3 | * This file is a part of LEMON, a generic C++ optimization library |
---|
4 | * |
---|
5 | * Copyright (C) 2003-2006 |
---|
6 | * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
---|
7 | * (Egervary Research Group on Combinatorial Optimization, EGRES). |
---|
8 | * |
---|
9 | * Permission to use, modify and distribute this software is granted |
---|
10 | * provided that this copyright notice appears in all copies. For |
---|
11 | * precise terms see the accompanying LICENSE file. |
---|
12 | * |
---|
13 | * This software is provided "AS IS" with no warranty of any kind, |
---|
14 | * express or implied, and with no claim as to its suitability for any |
---|
15 | * purpose. |
---|
16 | * |
---|
17 | */ |
---|
18 | |
---|
19 | #ifndef LEMON_LP_SOPLEX_H |
---|
20 | #define LEMON_LP_SOPLEX_H |
---|
21 | |
---|
22 | ///\file |
---|
23 | ///\brief Header of the LEMON-SOPLEX lp solver interface. |
---|
24 | |
---|
25 | #include <vector> |
---|
26 | #include <string> |
---|
27 | |
---|
28 | #include <lemon/lp_base.h> |
---|
29 | |
---|
30 | // Forward declaration |
---|
31 | namespace soplex { |
---|
32 | class SoPlex; |
---|
33 | } |
---|
34 | |
---|
35 | namespace lemon { |
---|
36 | |
---|
37 | /// \brief Interface for the SOPLEX solver |
---|
38 | /// |
---|
39 | /// This class implements an interface for the SOPLEX LP solver. |
---|
40 | class LpSoplex :virtual public LpSolverBase { |
---|
41 | protected: |
---|
42 | |
---|
43 | _lp_bits::RelocateIdHandler relocateIdHandler; |
---|
44 | |
---|
45 | soplex::SoPlex* soplex; |
---|
46 | bool solved; |
---|
47 | |
---|
48 | std::vector<std::string> colNames; |
---|
49 | |
---|
50 | std::vector<Value> primal_value; |
---|
51 | std::vector<Value> dual_value; |
---|
52 | |
---|
53 | |
---|
54 | public: |
---|
55 | |
---|
56 | typedef LpSolverBase Parent; |
---|
57 | |
---|
58 | |
---|
59 | /// \e |
---|
60 | LpSoplex(); |
---|
61 | /// \e |
---|
62 | ~LpSoplex(); |
---|
63 | |
---|
64 | protected: |
---|
65 | |
---|
66 | virtual LpSolverBase &_newLp(); |
---|
67 | virtual LpSolverBase &_copyLp(); |
---|
68 | |
---|
69 | virtual int _addCol(); |
---|
70 | virtual int _addRow(); |
---|
71 | virtual void _eraseCol(int i); |
---|
72 | virtual void _eraseRow(int i); |
---|
73 | virtual void _getColName(int col, std::string & name); |
---|
74 | virtual void _setColName(int col, const std::string & name); |
---|
75 | virtual void _setRowCoeffs(int i, LpRowIterator b, LpRowIterator e); |
---|
76 | virtual void _setColCoeffs(int i, LpColIterator b, LpColIterator e); |
---|
77 | virtual void _setCoeff(int row, int col, Value value); |
---|
78 | virtual Value _getCoeff(int row, int col); |
---|
79 | virtual void _setColLowerBound(int i, Value value); |
---|
80 | virtual Value _getColLowerBound(int i); |
---|
81 | virtual void _setColUpperBound(int i, Value value); |
---|
82 | virtual Value _getColUpperBound(int i); |
---|
83 | virtual void _setRowBounds(int i, Value lower, Value upper); |
---|
84 | virtual void _getRowBounds(int i, Value &lower, Value &upper); |
---|
85 | virtual void _setObjCoeff(int i, Value obj_coef); |
---|
86 | virtual Value _getObjCoeff(int i); |
---|
87 | virtual void _clearObj(); |
---|
88 | |
---|
89 | virtual SolveExitStatus _solve(); |
---|
90 | virtual Value _getPrimal(int i); |
---|
91 | virtual Value _getDual(int i); |
---|
92 | virtual Value _getPrimalValue(); |
---|
93 | virtual bool _isBasicCol(int i); |
---|
94 | |
---|
95 | virtual SolutionStatus _getPrimalStatus(); |
---|
96 | virtual SolutionStatus _getDualStatus(); |
---|
97 | virtual ProblemTypes _getProblemType(); |
---|
98 | |
---|
99 | |
---|
100 | virtual void _setMax(); |
---|
101 | virtual void _setMin(); |
---|
102 | virtual bool _isMax(); |
---|
103 | |
---|
104 | }; |
---|
105 | } //END OF NAMESPACE LEMON |
---|
106 | |
---|
107 | #endif //LEMON_LP_SOPLEX_H |
---|
108 | |
---|