# Changeset 1293:8ede2a6b2594 in lemon-0.x

Ignore:
Timestamp:
04/01/05 21:50:29 (15 years ago)
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1726
Message:
• Make lp stuff compilable
• Some 'set's removed
Location:
src/work/athos/lp
Files:
6 edited

Unmodified
Removed
• ## src/work/athos/lp/lp_base.h

 r1291 ///\e enum SolutionXXXType { ///\e INFEASIBLE = 0, ///\e UNBOUNDED = 1, ///\e OPTIMAL = 2, ///\e FEASIBLE = 3 enum SolutionStatus { ///\e SOLVED = 0, ///\e UNSOLVED = 1 }; enum SolutionType { ///\e INFEASIBLE = 0, ///\e UNDEFINED = 1, ///\e OPTIMAL = 2, ///\e FEASIBLE = 3 UNDEFINED = 0, ///\e INFEASIBLE = 1, ///\e FEASIBLE = 2, ///\e OPTIMAL = 3 }; ///\bug Wrong interface /// virtual SolutionXXXType _solve() = 0; virtual SolutionStatus _solve() = 0; ///\e ///\bug Wrong interface /// virtual Value _getSolution(int i) = 0; virtual Value _getPrimal(int i) = 0; ///\e /// Set the lower bound of a column (i.e a variable) /// The upper bound of a variable (column) have to be given by an /// The upper bound of a variable (column) has to be given by an /// extended number of type Value, i.e. a finite number of type /// Value or -\ref INF. void setColLowerBound(Col c, Value value) { void colLowerBound(Col c, Value value) { _setColLowerBound(cols.floatingId(c.id),value); } /// Set the upper bound of a column (i.e a variable) /// The upper bound of a variable (column) have to be given by an /// The upper bound of a variable (column) has to be given by an /// extended number of type Value, i.e. a finite number of type /// Value or \ref INF. void setColUpperBound(Col c, Value value) { void colUpperBound(Col c, Value value) { _setColUpperBound(cols.floatingId(c.id),value); }; /// Set the lower and the upper bounds of a column (i.e a variable) /// The lower and the upper bounds of /// a variable (column) have to be given by an /// extended number of type Value, i.e. a finite number of type /// Value, -\ref INF or \ref INF. void colBounds(Col c, Value lower, Value upper) { _setColLowerBound(cols.floatingId(c.id),lower); _setColUpperBound(cols.floatingId(c.id),upper); } /// Set the lower bound of a row (i.e a constraint) /// The lower bound of a linear expression (row) have to be given by an /// The lower bound of a linear expression (row) has to be given by an /// extended number of type Value, i.e. a finite number of type /// Value or -\ref INF. void setRowLowerBound(Row r, Value value) { void rowLowerBound(Row r, Value value) { _setRowLowerBound(rows.floatingId(r.id),value); }; /// Set the upper bound of a row (i.e a constraint) /// The upper bound of a linear expression (row) have to be given by an /// The upper bound of a linear expression (row) has to be given by an /// extended number of type Value, i.e. a finite number of type /// Value or \ref INF. void setRowUpperBound(Row r, Value value) { void rowUpperBound(Row r, Value value) { _setRowUpperBound(rows.floatingId(r.id),value); }; /// Set the lower and the upper bounds of a row (i.e a variable) /// The lower and the upper bounds of /// a constraint (row) have to be given by an /// extended number of type Value, i.e. a finite number of type /// Value, -\ref INF or \ref INF. void rowBounds(Row c, Value lower, Value upper) { _setRowLowerBound(rows.floatingId(c.id),lower); _setRowUpperBound(rows.floatingId(c.id),upper); } ///Set an element of the objective function void setObjCoeff(Col c, Value v) {_setObjCoeff(cols.floatingId(c.id),v); }; void objCoeff(Col c, Value v) {_setObjCoeff(cols.floatingId(c.id),v); }; ///Set the objective function clearObj(); for (Expr::iterator i=e.begin(); i!=e.end(); ++i) setObjCoeff((*i).first,(*i).second); objCoeff((*i).first,(*i).second); } ///\e SolutionType solve() { return _solve(); } SolutionStatus solve() { return _solve(); } ///@} ///\e Value solution(Col c) { return _getSolution(cols.floatingId(c.id)); } Value primal(Col c) { return _getPrimal(cols.floatingId(c.id)); } ///@}
• ## src/work/athos/lp/lp_glpk.cc

 r1263 LpGlpk::SolutionType LpGlpk::_solve() LpGlpk::SolutionStatus LpGlpk::_solve() { return OPTIMAL; return SOLVED; } LpGlpk::Value LpGlpk::_getSolution(int i) LpGlpk::Value LpGlpk::_getPrimal(int i) { return 0;
• ## src/work/athos/lp/lp_glpk.h

 r1263 ///\bug Unimplemented /// virtual SolutionType _solve(); virtual SolutionStatus _solve(); ///\e ///\bug Unimplemented /// virtual Value _getSolution(int i); virtual Value _getPrimal(int i); };
• ## src/work/athos/lp/lp_solver_skeleton.cc

 r1273 } LpSolverSkeleton::SolutionType LpSolverSkeleton::_solve() LpSolverSkeleton::SolutionStatus LpSolverSkeleton::_solve() { return OPTIMAL; return SOLVED; } LpSolverSkeleton::Value LpSolverSkeleton::_getSolution(int i) LpSolverSkeleton::Value LpSolverSkeleton::_getPrimal(int i) { return 0;
• ## src/work/athos/lp/lp_solver_skeleton.h

 r1273 virtual void _setRowUpperBound(int i, Value value); virtual void _setObjCoeff(int i, Value obj_coef); virtual SolutionType _solve(); virtual Value _getSolution(int i); virtual SolutionStatus _solve(); virtual Value _getPrimal(int i); public: LpSolverSkeleton() : LpSolverBase(), col_num(0), row_num(0) {}
• ## src/work/athos/lp/lp_test.cc

 r1273 for(EdgeIt e(g);e!=INVALID;++e) { lp.setColUpperBound(x[e],cap[e]); lp.setColLowerBound(x[e],0); lp.colUpperBound(x[e],cap[e]); lp.colLowerBound(x[e],0); }
Note: See TracChangeset for help on using the changeset viewer.