I really have no idea about what to write here now.
1.1 --- a/src/lemon/lp_base.h Thu Apr 21 06:06:56 2005 +0000
1.2 +++ b/src/lemon/lp_base.h Thu Apr 21 15:15:12 2005 +0000
1.3 @@ -433,6 +433,7 @@
1.4 virtual void _setColUpperBound(int i, Value value) = 0;
1.5 virtual void _setRowLowerBound(int i, Value value) = 0;
1.6 virtual void _setRowUpperBound(int i, Value value) = 0;
1.7 + virtual void _setRowBounds(int i, Value lower, Value upper) = 0;
1.8 virtual void _setObjCoeff(int i, Value obj_coef) = 0;
1.9 virtual void _clearObj()=0;
1.10 // virtual void _setObj(int length,
1.11 @@ -655,8 +656,8 @@
1.12 /// extended number of type Value, i.e. a finite number of type
1.13 /// Value, -\ref INF or \ref INF.
1.14 void rowBounds(Row c, Value lower, Value upper) {
1.15 - _setRowLowerBound(rows.floatingId(c.id),lower);
1.16 - _setRowUpperBound(rows.floatingId(c.id),upper);
1.17 + _setRowBounds(rows.floatingId(c.id),lower, upper);
1.18 + // _setRowUpperBound(rows.floatingId(c.id),upper);
1.19 }
1.20
1.21 ///Set an element of the objective function
2.1 --- a/src/lemon/lp_glpk.cc Thu Apr 21 06:06:56 2005 +0000
2.2 +++ b/src/lemon/lp_glpk.cc Thu Apr 21 15:15:12 2005 +0000
2.3 @@ -260,6 +260,38 @@
2.4 }
2.5 }
2.6 }
2.7 +
2.8 + void LpGlpk::_setRowBounds(int i, Value lb, Value ub)
2.9 + {
2.10 + //Bad parameter
2.11 + if (lb==INF || ub==-INF) {
2.12 + //FIXME error
2.13 + }
2.14 +
2.15 + if (lb == -INF){
2.16 + if (ub == INF){
2.17 + lpx_set_row_bnds(lp, i, LPX_FR, lb, ub);
2.18 + }
2.19 + else{
2.20 + lpx_set_row_bnds(lp, i, LPX_UP, lb, ub);
2.21 + }
2.22 + }
2.23 + else{
2.24 + if (ub==INF){
2.25 + lpx_set_row_bnds(lp, i, LPX_LO, lb, ub);
2.26 +
2.27 + }
2.28 + else{
2.29 + if (lb == ub){
2.30 + lpx_set_row_bnds(lp, i, LPX_FX, lb, ub);
2.31 + }
2.32 + else{
2.33 + lpx_set_row_bnds(lp, i, LPX_DB, lb, ub);
2.34 + }
2.35 + }
2.36 + }
2.37 +
2.38 + }
2.39
2.40 void LpGlpk::_setObjCoeff(int i, Value obj_coef)
2.41 {
3.1 --- a/src/lemon/lp_glpk.h Thu Apr 21 06:06:56 2005 +0000
3.2 +++ b/src/lemon/lp_glpk.h Thu Apr 21 15:15:12 2005 +0000
3.3 @@ -62,6 +62,7 @@
3.4 virtual void _setColUpperBound(int i, Value value);
3.5 virtual void _setRowLowerBound(int i, Value value);
3.6 virtual void _setRowUpperBound(int i, Value value);
3.7 + virtual void _setRowBounds(int i, Value lower, Value upper);
3.8 virtual void _setObjCoeff(int i, Value obj_coef);
3.9 virtual void _clearObj();
3.10 // virtual void _setObj(int length,