New functions in lp_glpk.cc. Sample file: lp_sample.cc.
2 #ifndef LEMON_LP_SOLVER_BASE_H
3 #define LEMON_LP_SOLVER_BASE_H
23 //#include <lemon/invalid.h>
24 //#include <expression.h>
26 //#include <lemon/max_flow.h>
27 //#include <augmenting_flow.h>
28 //#include <iter_map.h>
36 template <typename _Value>
39 /*! @name Uncategorized functions and types (public members)
49 static const Value INF;
54 virtual ~LpSolverBase() { }
56 /*! @name Low level interface (protected members)
57 Problem manipulating functions in the low level interface
62 //MATRIX MANIPULATING FUNCTIONS
65 virtual int _addCol() = 0;
67 virtual int _addRow() = 0;
69 virtual void _eraseCol(int i) = 0;
71 virtual void _eraseRow(int i) = 0;
73 virtual void _setRowCoeffs(int i,
74 const std::vector<std::pair<int, Value> >& coeffs) = 0;
76 /// This routine modifies \c coeffs only by the \c push_back method.
77 virtual void _getRowCoeffs(int i,
78 std::vector<std::pair<int, Value> >& coeffs) = 0;
80 virtual void _setColCoeffs(int i,
81 const std::vector<std::pair<int, Value> >& coeffs) = 0;
83 /// This routine modifies \c coeffs only by the \c push_back method.
84 virtual void _getColCoeffs(int i,
85 std::vector<std::pair<int, Value> >& coeffs) = 0;
87 virtual void _setCoeff(int col, int row, Value value) = 0;
89 virtual Value _getCoeff(int col, int row) = 0;
92 // enum Bound { FREE, LOWER, UPPER, DOUBLE, FIXED };
95 /// The lower bound of a variable (column) have to be given by an
96 /// extended number of type Value, i.e. a finite number of type
98 virtual void _setColLowerBound(int i, Value value) = 0;
100 /// The lower bound of a variable (column) is an
101 /// extended number of type Value, i.e. a finite number of type
103 virtual Value _getColLowerBound(int i) = 0;
105 /// The upper bound of a variable (column) have to be given by an
106 /// extended number of type Value, i.e. a finite number of type
108 virtual void _setColUpperBound(int i, Value value) = 0;
110 /// The upper bound of a variable (column) is an
111 /// extended number of type Value, i.e. a finite number of type
113 virtual Value _getColUpperBound(int i) = 0;
115 /// The lower bound of a linear expression (row) have to be given by an
116 /// extended number of type Value, i.e. a finite number of type
118 virtual void _setRowLowerBound(int i, Value value) = 0;
120 /// The lower bound of a linear expression (row) is an
121 /// extended number of type Value, i.e. a finite number of type
123 virtual Value _getRowLowerBound(int i) = 0;
125 /// The upper bound of a linear expression (row) have to be given by an
126 /// extended number of type Value, i.e. a finite number of type
128 virtual void _setRowUpperBound(int i, Value value) = 0;
130 /// The upper bound of a linear expression (row) is an
131 /// extended number of type Value, i.e. a finite number of type
133 virtual Value _getRowUpperBound(int i) = 0;
135 virtual void _setObjCoeff(int i, Value obj_coef) = 0;
137 virtual Value _getObjCoeff(int i) = 0;
139 //SOLUTION RETRIEVING
142 virtual Value _getPrimal(int i) = 0;
147 /*! @name MIP functions and types (public members)
152 virtual void _setColCont(int i) = 0;
154 virtual void _setColInt(int i) = 0;
156 virtual Value _getMIPPrimal(int i) = 0;
162 #endif //LEMON_LP_SOLVER_BASE_H