src/lemon/lp_base.h
changeset 1378 b82995734b2d
parent 1376 8de0c1aeeb32
child 1379 96a34c0904dd
equal deleted inserted replaced
6:b5f3505c8f14 7:e30ae3a9bf9a
   432     virtual void _setColLowerBound(int i, Value value) = 0;
   432     virtual void _setColLowerBound(int i, Value value) = 0;
   433     virtual void _setColUpperBound(int i, Value value) = 0;
   433     virtual void _setColUpperBound(int i, Value value) = 0;
   434     virtual void _setRowLowerBound(int i, Value value) = 0;
   434     virtual void _setRowLowerBound(int i, Value value) = 0;
   435     virtual void _setRowUpperBound(int i, Value value) = 0;
   435     virtual void _setRowUpperBound(int i, Value value) = 0;
   436     virtual void _setObjCoeff(int i, Value obj_coef) = 0;
   436     virtual void _setObjCoeff(int i, Value obj_coef) = 0;
   437     virtual void _setObj(int length,
   437     virtual void _clearObj()=0;
   438                          int  const * indices, 
   438 //     virtual void _setObj(int length,
   439                          Value  const * values ) = 0;
   439 //                          int  const * indices, 
       
   440 //                          Value  const * values ) = 0;
   440     virtual SolveExitStatus _solve() = 0;
   441     virtual SolveExitStatus _solve() = 0;
   441     virtual Value _getPrimal(int i) = 0;
   442     virtual Value _getPrimal(int i) = 0;
   442     virtual Value _getPrimalValue() = 0;
   443     virtual Value _getPrimalValue() = 0;
   443     virtual SolutionStatus _getPrimalStatus() = 0;
   444     virtual SolutionStatus _getPrimalStatus() = 0;
   444     virtual void _setMax() = 0;
   445     virtual void _setMax() = 0;
   447     //Own protected stuff
   448     //Own protected stuff
   448     
   449     
   449     //Constant component of the objective function
   450     //Constant component of the objective function
   450     Value obj_const_comp;
   451     Value obj_const_comp;
   451     
   452     
   452     ///\e
   453 
   453     
   454 
   454     ///\bug Unimplemented
       
   455     void clearObj() {}
       
   456     
   455     
   457   public:
   456   public:
   458 
   457 
   459     ///\e
   458     ///\e
   460     LpSolverBase() : obj_const_comp(0) {}
   459     LpSolverBase() : obj_const_comp(0) {}
   665     ///Set the objective function
   664     ///Set the objective function
   666     
   665     
   667     ///\param e is a linear expression of type \ref Expr.
   666     ///\param e is a linear expression of type \ref Expr.
   668     ///\bug The previous objective function is not cleared!
   667     ///\bug The previous objective function is not cleared!
   669     void setObj(Expr e) {
   668     void setObj(Expr e) {
   670       clearObj();
   669       _clearObj();
   671       for (Expr::iterator i=e.begin(); i!=e.end(); ++i)
   670       for (Expr::iterator i=e.begin(); i!=e.end(); ++i)
   672 	objCoeff((*i).first,(*i).second);
   671 	objCoeff((*i).first,(*i).second);
   673       obj_const_comp=e.constComp();
   672       obj_const_comp=e.constComp();
   674     }
   673     }
   675 
   674