[Lemon-commits] deba: r3184 - in hugo/trunk: demo lemon test

Lemon SVN svn at lemon.cs.elte.hu
Mon Feb 19 19:21:29 CET 2007


Author: deba
Date: Mon Feb 19 19:21:28 2007
New Revision: 3184

Modified:
   hugo/trunk/demo/lp_demo.cc
   hugo/trunk/demo/lp_maxflow_demo.cc
   hugo/trunk/demo/mip_demo.cc
   hugo/trunk/lemon/lp_base.h
   hugo/trunk/lemon/lp_utils.h
   hugo/trunk/test/lp_test.cc
   hugo/trunk/test/mip_test.cc

Log:
Naming convention changes

   setObj => obj
   is_min => isMin
   is_max => isMax



Modified: hugo/trunk/demo/lp_demo.cc
==============================================================================
--- hugo/trunk/demo/lp_demo.cc	(original)
+++ hugo/trunk/demo/lp_demo.cc	Mon Feb 19 19:21:28 2007
@@ -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();

Modified: hugo/trunk/demo/lp_maxflow_demo.cc
==============================================================================
--- hugo/trunk/demo/lp_maxflow_demo.cc	(original)
+++ hugo/trunk/demo/lp_maxflow_demo.cc	Mon Feb 19 19:21:28 2007
@@ -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

Modified: hugo/trunk/demo/mip_demo.cc
==============================================================================
--- hugo/trunk/demo/mip_demo.cc	(original)
+++ hugo/trunk/demo/mip_demo.cc	Mon Feb 19 19:21:28 2007
@@ -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();

Modified: hugo/trunk/lemon/lp_base.h
==============================================================================
--- hugo/trunk/lemon/lp_base.h	(original)
+++ hugo/trunk/lemon/lp_base.h	Mon Feb 19 19:21:28 2007
@@ -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(); }
     
     ///@}
 

Modified: hugo/trunk/lemon/lp_utils.h
==============================================================================
--- hugo/trunk/lemon/lp_utils.h	(original)
+++ hugo/trunk/lemon/lp_utils.h	Mon Feb 19 19:21:28 2007
@@ -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 ";

Modified: hugo/trunk/test/lp_test.cc
==============================================================================
--- hugo/trunk/test/lp_test.cc	(original)
+++ hugo/trunk/test/lp_test.cc	Mon Feb 19 19:21:28 2007
@@ -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<<lp.colLowerBound(x1)<<std::endl;
   check(  lp.colLowerBound(x1)==0,"The lower bound for variable x1 should be 0.");

Modified: hugo/trunk/test/mip_test.cc
==============================================================================
--- hugo/trunk/test/mip_test.cc	(original)
+++ hugo/trunk/test/mip_test.cc	Mon Feb 19 19:21:28 2007
@@ -52,7 +52,7 @@
 
 
   //Objective function
-  mip.setObj(x1);
+  mip.obj(x1);
 
   mip.max();
 



More information about the Lemon-commits mailing list