00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef LEMON_LP_CPLEX_H
00018 #define LEMON_LP_CPLEX_H
00019
00022
00023 #include <lemon/lp_base.h>
00024
00025 extern "C" {
00026 #include <ilcplex/cplex.h>
00027 }
00028
00029 namespace lemon {
00030
00031
00035 class LpCplex : public LpSolverBase {
00036
00037 public:
00038
00039 typedef LpSolverBase Parent;
00040
00042 int status;
00043 CPXENVptr env;
00044 CPXLPptr lp;
00045
00046
00048 LpCplex();
00050 ~LpCplex();
00051
00052 protected:
00053 virtual LpSolverBase &_newLp();
00054 virtual LpSolverBase &_copyLp();
00055
00056 virtual int _addCol();
00057 virtual int _addRow();
00058 virtual void _eraseCol(int i);
00059 virtual void _eraseRow(int i);
00060 virtual void _setRowCoeffs(int i,
00061 int length,
00062 const int * indices,
00063 const Value * values );
00064 virtual void _setColCoeffs(int i,
00065 int length,
00066 const int * indices,
00067 const Value * values);
00068 virtual void _setCoeff(int row, int col, Value value);
00069 virtual void _setColLowerBound(int i, Value value);
00070 virtual void _setColUpperBound(int i, Value value);
00071
00072
00073 virtual void _setRowBounds(int i, Value lower, Value upper);
00074 virtual void _setObjCoeff(int i, Value obj_coef);
00075 virtual void _clearObj();
00077
00078 virtual SolveExitStatus _solve();
00079
00080 virtual Value _getPrimal(int i);
00081
00082
00083 virtual Value _getPrimalValue();
00084
00085 virtual SolutionStatus _getPrimalStatus();
00086 virtual SolutionStatus _getDualStatus();
00087 virtual ProblemTypes _getProblemType();
00088
00089
00090 virtual void _setMax();
00091 virtual void _setMin();
00092
00093 };
00094 }
00095
00096 #endif //LEMON_LP_CPLEX_H
00097