diff -r 61f989e3e525 -r a490938ad0aa src/work/athos/lp/lp_base.h --- a/src/work/athos/lp/lp_base.h Fri Mar 25 15:32:05 2005 +0000 +++ b/src/work/athos/lp/lp_base.h Fri Mar 25 16:19:03 2005 +0000 @@ -100,6 +100,18 @@ public: + ///\e + enum SolutionType { + ///\e + INFEASIBLE = 0, + ///\e + UNBOUNDED = 1, + ///\e + OPTIMAL = 2, + ///\e + FEASIBLE = 3, + }; + ///The floating point type used by the solver typedef double Value; ///The infinity constant @@ -160,8 +172,6 @@ _FixId rows; _FixId cols; - //MATRIX MANIPULATING FUNCTIONS - /// \e virtual int _addCol() = 0; /// \e @@ -212,6 +222,17 @@ virtual void _setObjCoeff(int i, Value obj_coef) = 0; ///\e + + ///\bug Wrong interface + /// + virtual SolutionType _solve() = 0; + + ///\e + + ///\bug Wrong interface + /// + virtual Value _getSolution(int i) = 0; + ///\e ///\bug unimplemented!!!! void clearObj() {} @@ -221,8 +242,13 @@ ///\e virtual ~LpSolverBase() {} + ///\name Building up and modification of the LP + + ///@{ + ///Add a new empty column (i.e a new variable) to the LP Col addCol() { Col c; c.id=cols.insert(_addCol()); return c;} + ///\brief Fill the elements of a container with newly created columns ///(i.e a new variables) /// @@ -261,6 +287,7 @@ return s; } #endif + ///Add a new empty row (i.e a new constaint) to the LP ///This function adds a new empty row (i.e a new constaint) to the LP. @@ -348,6 +375,27 @@ for (Expr::iterator i=e.begin(); i!=e.end(); ++i) setObjCoeff((*i).first,(*i).second); } + + ///@} + + + ///\name Solving the LP + + ///@{ + + ///\e + SolutionType solve() { return _solve(); } + + ///@} + + ///\name Obtaining the solution LP + + ///@{ + + ///\e + Value solution(Col c) { return _getSolution(cols.floatingId(c.id)); } + + ///@} };