1 /* -*- C++ -*- |
|
2 * src/lemon/lp_cplex.h - Part of LEMON, a generic C++ optimization library |
|
3 * |
|
4 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
|
5 * (Egervary Research Group on Combinatorial Optimization, EGRES). |
|
6 * |
|
7 * Permission to use, modify and distribute this software is granted |
|
8 * provided that this copyright notice appears in all copies. For |
|
9 * precise terms see the accompanying LICENSE file. |
|
10 * |
|
11 * This software is provided "AS IS" with no warranty of any kind, |
|
12 * express or implied, and with no claim as to its suitability for any |
|
13 * purpose. |
|
14 * |
|
15 */ |
|
16 |
|
17 #ifndef LEMON_LP_CPLEX_H |
|
18 #define LEMON_LP_CPLEX_H |
|
19 |
|
20 ///\file |
|
21 ///\brief Header of the LEMON-CPLEX lp solver interface. |
|
22 |
|
23 #include <lemon/lp_base.h> |
|
24 |
|
25 extern "C" { |
|
26 #include <ilcplex/cplex.h> |
|
27 } |
|
28 |
|
29 namespace lemon { |
|
30 |
|
31 |
|
32 /// \brief Interface for the CPLEX solver |
|
33 /// |
|
34 /// This class implements an interface for the CPLEX LP solver. |
|
35 class LpCplex : public LpSolverBase { |
|
36 |
|
37 public: |
|
38 |
|
39 typedef LpSolverBase Parent; |
|
40 |
|
41 /// \e |
|
42 int status; |
|
43 CPXENVptr env; |
|
44 CPXLPptr lp; |
|
45 |
|
46 |
|
47 /// \e |
|
48 LpCplex(); |
|
49 /// \e |
|
50 ~LpCplex(); |
|
51 |
|
52 protected: |
|
53 virtual LpSolverBase &_newLp(); |
|
54 virtual LpSolverBase &_copyLp(); |
|
55 |
|
56 virtual int _addCol(); |
|
57 virtual int _addRow(); |
|
58 virtual void _eraseCol(int i); |
|
59 virtual void _eraseRow(int i); |
|
60 virtual void _setRowCoeffs(int i, |
|
61 int length, |
|
62 const int * indices, |
|
63 const Value * values ); |
|
64 virtual void _setColCoeffs(int i, |
|
65 int length, |
|
66 const int * indices, |
|
67 const Value * values); |
|
68 virtual void _setCoeff(int row, int col, Value value); |
|
69 virtual void _setColLowerBound(int i, Value value); |
|
70 virtual void _setColUpperBound(int i, Value value); |
|
71 // virtual void _setRowLowerBound(int i, Value value); |
|
72 // virtual void _setRowUpperBound(int i, Value value); |
|
73 virtual void _setRowBounds(int i, Value lower, Value upper); |
|
74 virtual void _setObjCoeff(int i, Value obj_coef); |
|
75 virtual void _clearObj(); |
|
76 ///\e |
|
77 |
|
78 ///\bug Unimplemented |
|
79 /// |
|
80 virtual SolveExitStatus _solve(); |
|
81 ///\e |
|
82 |
|
83 ///\bug Unimplemented |
|
84 /// |
|
85 virtual Value _getPrimal(int i); |
|
86 ///\e |
|
87 |
|
88 ///\bug Unimplemented |
|
89 /// |
|
90 virtual Value _getPrimalValue(); |
|
91 ///\e |
|
92 |
|
93 ///\bug Unimplemented |
|
94 /// |
|
95 virtual SolutionStatus _getPrimalStatus(); |
|
96 |
|
97 ///\e |
|
98 |
|
99 ///\bug Unimplemented |
|
100 /// |
|
101 virtual void _setMax(); |
|
102 ///\e |
|
103 |
|
104 ///\bug Unimplemented |
|
105 /// |
|
106 virtual void _setMin(); |
|
107 |
|
108 }; |
|
109 } //END OF NAMESPACE LEMON |
|
110 |
|
111 #endif //LEMON_LP_CPLEX_H |
|
112 |
|