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, ConstRowIterator b, ConstRowIterator e); |
---|
76 | virtual void _getRowCoeffs(int i, RowIterator b); |
---|
77 | virtual void _setColCoeffs(int i, ConstColIterator b, ConstColIterator e); |
---|
78 | virtual void _getColCoeffs(int i, ColIterator b); |
---|
79 | virtual void _setCoeff(int row, int col, Value value); |
---|
80 | virtual Value _getCoeff(int row, int col); |
---|
81 | virtual void _setColLowerBound(int i, Value value); |
---|
82 | virtual Value _getColLowerBound(int i); |
---|
83 | virtual void _setColUpperBound(int i, Value value); |
---|
84 | virtual Value _getColUpperBound(int i); |
---|
85 | virtual void _setRowBounds(int i, Value lower, Value upper); |
---|
86 | virtual void _getRowBounds(int i, Value &lower, Value &upper); |
---|
87 | virtual void _setObjCoeff(int i, Value obj_coef); |
---|
88 | virtual Value _getObjCoeff(int i); |
---|
89 | virtual void _clearObj(); |
---|
90 | |
---|
91 | virtual SolveExitStatus _solve(); |
---|
92 | virtual Value _getPrimal(int i); |
---|
93 | virtual Value _getDual(int i); |
---|
94 | virtual Value _getPrimalValue(); |
---|
95 | virtual bool _isBasicCol(int i); |
---|
96 | |
---|
97 | virtual SolutionStatus _getPrimalStatus(); |
---|
98 | virtual SolutionStatus _getDualStatus(); |
---|
99 | virtual ProblemTypes _getProblemType(); |
---|
100 | |
---|
101 | |
---|
102 | virtual void _setMax(); |
---|
103 | virtual void _setMin(); |
---|
104 | virtual bool _isMax(); |
---|
105 | |
---|
106 | }; |
---|
107 | } //END OF NAMESPACE LEMON |
---|
108 | |
---|
109 | #endif //LEMON_LP_SOPLEX_H |
---|
110 | |
---|