[Lemon-commits] [lemon_svn] alpar: r1765 - in hugo/trunk/src: demo lemon

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:47:25 CET 2006


Author: alpar
Date: Fri Apr  8 16:40:37 2005
New Revision: 1765

Modified:
   hugo/trunk/src/demo/lp_demo.cc
   hugo/trunk/src/lemon/lp_glpk.cc
   hugo/trunk/src/lemon/lp_glpk.h

Log:
Add presolver() to turn on/off the GLPK presolver

Modified: hugo/trunk/src/demo/lp_demo.cc
==============================================================================
--- hugo/trunk/src/demo/lp_demo.cc	(original)
+++ hugo/trunk/src/demo/lp_demo.cc	Fri Apr  8 16:40:37 2005
@@ -38,6 +38,11 @@
     lp.setObj(ex);
   }
   lp.max();
+
+  lp.presolver(true);
+  
+  lp.messageLevel(3);
+
   lp.solve();
 
   return lp.primalValue();
@@ -45,13 +50,10 @@
 
 int main() 
 {
-  LpGlpk lp_glpk;
-
   ListGraph g;
   ListGraph::Node s;
   ListGraph::Node t;
   
-
   ListGraph::EdgeMap<double> cap(g);
   
   GraphReader<ListGraph> reader(std::cin,g);

Modified: hugo/trunk/src/lemon/lp_glpk.cc
==============================================================================
--- hugo/trunk/src/lemon/lp_glpk.cc	(original)
+++ hugo/trunk/src/lemon/lp_glpk.cc	Fri Apr  8 16:40:37 2005
@@ -313,6 +313,11 @@
     lpx_set_int_parm(lp, LPX_K_MSGLEV, m);
   }
 
+  void LpGlpk::presolver(bool b)
+  {
+    lpx_set_int_parm(lp, LPX_K_PRESOL, b);
+  }
+
  
 } //END OF NAMESPACE LEMON
 

Modified: hugo/trunk/src/lemon/lp_glpk.h
==============================================================================
--- hugo/trunk/src/lemon/lp_glpk.h	(original)
+++ hugo/trunk/src/lemon/lp_glpk.h	Fri Apr  8 16:40:37 2005
@@ -22,7 +22,7 @@
 
 #include "lp_base.h"
 extern "C" {
-#include "glpk.h"
+#include <glpk.h>
 }
 
 namespace lemon {
@@ -76,6 +76,8 @@
   public:
     ///Set the verbosity of the messages
 
+    ///Set the verbosity of the messages
+    ///
     ///\param m is the level of the messages output by the solver routines.
     ///The possible values are:
     ///- 0 --- no output (default value)
@@ -83,6 +85,12 @@
     ///- 2 --- normal output
     ///- 3 --- full output (includes informational messages)
     void messageLevel(int m);
+    ///Turns on or off the presolver
+
+    ///Turns on (\c b is \c true) or off (\c b is \c false) the presolver
+    ///
+    ///The presolver is off by default.
+    void presolver(bool b);
     
   };
 } //END OF NAMESPACE LEMON



More information about the Lemon-commits mailing list