# HG changeset patch # User alpar # Date 1112971237 0 # Node ID 85f1c483279e17c0c1a2ece8c4745f2fdb95c826 # Parent 916ec8699dc3d96fd01e7031499d13e2b42042f7 Add presolver() to turn on/off the GLPK presolver diff -r 916ec8699dc3 -r 85f1c483279e src/demo/lp_demo.cc --- a/src/demo/lp_demo.cc Fri Apr 08 14:21:40 2005 +0000 +++ b/src/demo/lp_demo.cc Fri Apr 08 14:40:37 2005 +0000 @@ -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 cap(g); GraphReader reader(std::cin,g); diff -r 916ec8699dc3 -r 85f1c483279e src/lemon/lp_glpk.cc --- a/src/lemon/lp_glpk.cc Fri Apr 08 14:21:40 2005 +0000 +++ b/src/lemon/lp_glpk.cc Fri Apr 08 14:40:37 2005 +0000 @@ -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 diff -r 916ec8699dc3 -r 85f1c483279e src/lemon/lp_glpk.h --- a/src/lemon/lp_glpk.h Fri Apr 08 14:21:40 2005 +0000 +++ b/src/lemon/lp_glpk.h Fri Apr 08 14:40:37 2005 +0000 @@ -22,7 +22,7 @@ #include "lp_base.h" extern "C" { -#include "glpk.h" +#include } 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