src/work/athos/lp/lp_base.h
changeset 1303 9bcc455da4f5
parent 1295 02a403c305b9
equal deleted inserted replaced
17:a93a839a693a 18:1aaa35c8e280
   103   class LpSolverBase {
   103   class LpSolverBase {
   104     
   104     
   105   public:
   105   public:
   106 
   106 
   107     ///\e
   107     ///\e
   108     enum SolutionStatus {
   108     enum SolveExitStatus {
   109       ///\e
   109       ///\e
   110       SOLVED = 0,
   110       SOLVED = 0,
   111       ///\e
   111       ///\e
   112       UNSOLVED = 1
   112       UNSOLVED = 1
   113     };
   113     };
   114       
   114       
   115     ///\e
   115     ///\e
   116     enum SolutionType {
   116     enum SolutionStatus {
   117       ///Feasible solution has'n been found (but may exist).
   117       ///Feasible solution has'n been found (but may exist).
   118 
   118 
   119       ///\todo NOTFOUND might be a better name.
   119       ///\todo NOTFOUND might be a better name.
   120       ///
   120       ///
   121       UNDEFINED = 0,
   121       UNDEFINED = 0,
   388     virtual void _setColLowerBound(int i, Value value) = 0;
   388     virtual void _setColLowerBound(int i, Value value) = 0;
   389     virtual void _setColUpperBound(int i, Value value) = 0;
   389     virtual void _setColUpperBound(int i, Value value) = 0;
   390     virtual void _setRowLowerBound(int i, Value value) = 0;
   390     virtual void _setRowLowerBound(int i, Value value) = 0;
   391     virtual void _setRowUpperBound(int i, Value value) = 0;
   391     virtual void _setRowUpperBound(int i, Value value) = 0;
   392     virtual void _setObjCoeff(int i, Value obj_coef) = 0;
   392     virtual void _setObjCoeff(int i, Value obj_coef) = 0;
   393     virtual SolutionStatus _solve() = 0;
   393     virtual SolveExitStatus _solve() = 0;
   394     virtual Value _getPrimal(int i) = 0;
   394     virtual Value _getPrimal(int i) = 0;
   395     virtual SolutionType _getPrimalType() = 0;
   395     virtual SolutionStatus _getPrimalType() = 0;
   396 
   396 
   397 
   397 
   398     void clearObj() {}
   398     void clearObj() {}
   399   public:
   399   public:
   400 
   400 
   612     ///\name Solve the LP
   612     ///\name Solve the LP
   613 
   613 
   614     ///@{
   614     ///@{
   615 
   615 
   616     ///\e
   616     ///\e
   617     SolutionStatus solve() { return _solve(); }
   617     SolveExitStatus solve() { return _solve(); }
   618     
   618     
   619     ///@}
   619     ///@}
   620     
   620     
   621     ///\name Obtain the solution
   621     ///\name Obtain the solution
   622 
   622 
   623     ///@{
   623     ///@{
   624 
   624 
   625     ///\e
   625     ///\e
   626     SolutionType primalType() {
   626     SolutionStatus primalType() {
   627       return _getPrimalType();
   627       return _getPrimalType();
   628     }
   628     }
   629 
   629 
   630     ///\e
   630     ///\e
   631     Value primal(Col c) { return _getPrimal(cols.floatingId(c.id)); }
   631     Value primal(Col c) { return _getPrimal(cols.floatingId(c.id)); }