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