diff -r 8b18b6fed090 -r 18fc834761d9 lemon/lp_base.h --- a/lemon/lp_base.h Mon Dec 04 15:00:24 2006 +0000 +++ b/lemon/lp_base.h Mon Dec 04 16:48:13 2006 +0000 @@ -703,12 +703,15 @@ virtual void _setRowCoeffs(int i, LpRowIterator b, LpRowIterator e) = 0; virtual void _setColCoeffs(int i, LpColIterator b, LpColIterator e) = 0; virtual void _setCoeff(int row, int col, Value value) = 0; + virtual Value _getCoeff(int row, int col) = 0; + virtual void _setColLowerBound(int i, Value value) = 0; virtual void _setColUpperBound(int i, Value value) = 0; // virtual void _setRowLowerBound(int i, Value value) = 0; // virtual void _setRowUpperBound(int i, Value value) = 0; virtual void _setRowBounds(int i, Value lower, Value upper) = 0; virtual void _setObjCoeff(int i, Value obj_coef) = 0; + virtual Value _getObjCoeff(int i) = 0; virtual void _clearObj()=0; virtual SolveExitStatus _solve() = 0; @@ -725,6 +728,9 @@ virtual void _setMax() = 0; virtual void _setMin() = 0; + + virtual bool _isMax() = 0; + //Own protected stuff //Constant component of the objective function @@ -1000,6 +1006,16 @@ _setCoeff(_lpId(r),_lpId(c), val); } + /// Get an element of the coefficient matrix of the LP + + ///\param r is the row of the element in question + ///\param c is the coloumn of the element in question + ///\return the corresponding coefficient + + Value coeff(Row r, Col c){ + return _getCoeff(_lpId(r),_lpId(c)); + } + /// Set the lower bound of a column (i.e a variable) /// The lower bound of a variable (column) has to be given by an @@ -1171,8 +1187,12 @@ ///Set an element of the objective function void objCoeff(Col c, Value v) {_setObjCoeff(_lpId(c),v); }; + + ///Get an element of the objective function + Value objCoeff(Col c) {return _getObjCoeff(_lpId(c)); }; + ///Set the objective function - + ///\param e is a linear expression of type \ref Expr. ///\bug Is should be called obj() void setObj(Expr e) { @@ -1187,6 +1207,11 @@ ///Minimize void min() { _setMin(); } + ///Query function: is this a maximization problem? + bool is_max() {return _isMax(); } + + ///Query function: is this a minimization problem? + bool is_min() {return !is_max(); } ///@}