# HG changeset patch # User deba # Date 1171909288 0 # Node ID 6ae1a97055a222d695a560514e9805477640a4e4 # Parent 6b2e8b734ae719ae76ae39085894b86f32c2ca2c Naming convention changes setObj => obj is_min => isMin is_max => isMax diff -r 6b2e8b734ae7 -r 6ae1a97055a2 demo/lp_demo.cc --- a/demo/lp_demo.cc Mon Feb 19 12:11:41 2007 +0000 +++ b/demo/lp_demo.cc Mon Feb 19 18:21:28 2007 +0000 @@ -65,7 +65,7 @@ lp.colLowerBound(x2, 0); lp.colLowerBound(x3, 0); //Objective function - lp.setObj(10*x1+6*x2+4*x3); + lp.obj(10*x1+6*x2+4*x3); //Call the routine of the underlying LP solver lp.solve(); diff -r 6b2e8b734ae7 -r 6ae1a97055a2 demo/lp_maxflow_demo.cc --- a/demo/lp_maxflow_demo.cc Mon Feb 19 12:11:41 2007 +0000 +++ b/demo/lp_maxflow_demo.cc Mon Feb 19 18:21:28 2007 +0000 @@ -74,7 +74,7 @@ Lp::Expr obj; for(InEdgeIt e(g,t);e!=INVALID;++e) obj+=x[e]; for(OutEdgeIt e(g,t);e!=INVALID;++e) obj-=x[e]; - lp.setObj(obj); + lp.obj(obj); //Maximization diff -r 6b2e8b734ae7 -r 6ae1a97055a2 demo/mip_demo.cc --- a/demo/mip_demo.cc Mon Feb 19 12:11:41 2007 +0000 +++ b/demo/mip_demo.cc Mon Feb 19 18:21:28 2007 +0000 @@ -31,7 +31,7 @@ ilp.colLowerBound(x2, 0); ilp.colLowerBound(x3, 0); //Objective function - ilp.setObj(10*x1+6*x2+4*x3); + ilp.obj(10*x1+6*x2+4*x3); //Call the routine of the underlying LP solver ilp.solve(); diff -r 6b2e8b734ae7 -r 6ae1a97055a2 lemon/lp_base.h --- a/lemon/lp_base.h Mon Feb 19 12:11:41 2007 +0000 +++ b/lemon/lp_base.h Mon Feb 19 18:21:28 2007 +0000 @@ -972,7 +972,7 @@ ///\param l is lower bound (-\ref INF means no bound) ///\param e is a linear expression (see \ref Expr) ///\param u is the upper bound (\ref INF means no bound) - ///\bug This is a temportary function. The interface will change to + ///\bug This is a temporary function. The interface will change to ///a better one. ///\todo Option to control whether a constraint with a single variable is ///added or not. @@ -1009,7 +1009,7 @@ ///\param e is a linear expression (see \ref Expr) ///\param u is the upper bound (\ref INF means no bound) ///\return The created row. - ///\bug This is a temportary function. The interface will change to + ///\bug This is a temporary function. The interface will change to ///a better one. Row addRow(Value l,const Expr &e, Value u) { Row r=addRow(); @@ -1284,8 +1284,7 @@ ///Set the objective function ///\param e is a linear expression of type \ref Expr. - ///\bug Is should be called obj() - void setObj(Expr e) { + void obj(Expr e) { _clearObj(); for (Expr::iterator i=e.begin(); i!=e.end(); ++i) objCoeff((*i).first,(*i).second); @@ -1313,10 +1312,10 @@ void min() { _setMin(); } ///Query function: is this a maximization problem? - bool is_max() const {return _isMax(); } + bool isMax() const {return _isMax(); } ///Query function: is this a minimization problem? - bool is_min() const {return !is_max(); } + bool isMin() const {return !isMax(); } ///@} diff -r 6b2e8b734ae7 -r 6ae1a97055a2 lemon/lp_utils.h --- a/lemon/lp_utils.h Mon Feb 19 12:11:41 2007 +0000 +++ b/lemon/lp_utils.h Mon Feb 19 18:21:28 2007 +0000 @@ -432,7 +432,7 @@ LpSolverBase::Expr expr; is >> std::ws; readExpression(is, expr); - lp.setObj(expr); + lp.obj(expr); if (sense == "min") { lp.min(); } else { @@ -943,7 +943,7 @@ os << "objective" << std::endl; os << " "; - if (lp.is_min()) { + if (lp.isMin()) { os << "min "; } else { os << "max "; diff -r 6b2e8b734ae7 -r 6ae1a97055a2 test/lp_test.cc --- a/test/lp_test.cc Mon Feb 19 12:11:41 2007 +0000 +++ b/test/lp_test.cc Mon Feb 19 18:21:28 2007 +0000 @@ -291,14 +291,14 @@ lp.colLowerBound(x1, 0); lp.colLowerBound(x2, 0); //Objective function - lp.setObj(x1+x2); + lp.obj(x1+x2); lp.max(); //Testing the problem retrieving routines check(lp.objCoeff(x1)==1,"First term should be 1 in the obj function!"); - check(lp.is_max(),"This is a maximization!"); + check(lp.isMax(),"This is a maximization!"); check(lp.coeff(upright,x1)==1,"The coefficient in question is 1!"); // std::cout<