lemon/glpk.h
changeset 619 ec817dfc2cb7
parent 565 7ab97e2a0c33
child 650 a8dfe89b7719
equal deleted inserted replaced
7:4243c02a8713 8:d7b3edf5085f
    97 
    97 
    98     virtual void _setSense(Sense);
    98     virtual void _setSense(Sense);
    99     virtual Sense _getSense() const;
    99     virtual Sense _getSense() const;
   100 
   100 
   101     virtual void _clear();
   101     virtual void _clear();
       
   102 
       
   103     virtual void _messageLevel(MessageLevel level);
   102 
   104 
   103   private:
   105   private:
   104 
   106 
   105     static void freeEnv();
   107     static void freeEnv();
   106 
   108 
   109         freeEnv();
   111         freeEnv();
   110       }
   112       }
   111     };
   113     };
   112     
   114     
   113     static FreeEnvHelper freeEnvHelper;
   115     static FreeEnvHelper freeEnvHelper;
       
   116 
       
   117   protected:
       
   118     
       
   119     int _message_level;
   114     
   120     
   115   public:
   121   public:
   116 
   122 
   117     ///Pointer to the underlying GLPK data structure.
   123     ///Pointer to the underlying GLPK data structure.
   118     LPX *lpx() {return lp;}
   124     LPX *lpx() {return lp;}
   189     ///Turns on (\c b is \c true) or off (\c b is \c false) the presolver
   195     ///Turns on (\c b is \c true) or off (\c b is \c false) the presolver
   190     ///
   196     ///
   191     ///The presolver is off by default.
   197     ///The presolver is off by default.
   192     void presolver(bool presolve);
   198     void presolver(bool presolve);
   193 
   199 
   194     ///Enum for \c messageLevel() parameter
       
   195     enum MessageLevel {
       
   196       /// no output (default value)
       
   197       MESSAGE_NO_OUTPUT = 0,
       
   198       /// error messages only
       
   199       MESSAGE_ERROR_MESSAGE = 1,
       
   200       /// normal output
       
   201       MESSAGE_NORMAL_OUTPUT = 2,
       
   202       /// full output (includes informational messages)
       
   203       MESSAGE_FULL_OUTPUT = 3
       
   204     };
       
   205 
       
   206   private:
       
   207 
       
   208     MessageLevel _message_level;
       
   209 
       
   210   public:
       
   211 
       
   212     ///Set the verbosity of the messages
       
   213 
       
   214     ///Set the verbosity of the messages
       
   215     ///
       
   216     ///\param m is the level of the messages output by the solver routines.
       
   217     void messageLevel(MessageLevel m);
       
   218   };
   200   };
   219 
   201 
   220   /// \brief Interface for the GLPK MIP solver
   202   /// \brief Interface for the GLPK MIP solver
   221   ///
   203   ///
   222   /// This class implements an interface for the GLPK MIP solver.
   204   /// This class implements an interface for the GLPK MIP solver.
   242     virtual SolveExitStatus _solve();
   224     virtual SolveExitStatus _solve();
   243     virtual ProblemType _getType() const;
   225     virtual ProblemType _getType() const;
   244     virtual Value _getSol(int i) const;
   226     virtual Value _getSol(int i) const;
   245     virtual Value _getSolValue() const;
   227     virtual Value _getSolValue() const;
   246 
   228 
   247     ///Enum for \c messageLevel() parameter
       
   248     enum MessageLevel {
       
   249       /// no output (default value)
       
   250       MESSAGE_NO_OUTPUT = 0,
       
   251       /// error messages only
       
   252       MESSAGE_ERROR_MESSAGE = 1,
       
   253       /// normal output
       
   254       MESSAGE_NORMAL_OUTPUT = 2,
       
   255       /// full output (includes informational messages)
       
   256       MESSAGE_FULL_OUTPUT = 3
       
   257     };
       
   258 
       
   259   private:
       
   260 
       
   261     MessageLevel _message_level;
       
   262 
       
   263   public:
       
   264 
       
   265     ///Set the verbosity of the messages
       
   266 
       
   267     ///Set the verbosity of the messages
       
   268     ///
       
   269     ///\param m is the level of the messages output by the solver routines.
       
   270     void messageLevel(MessageLevel m);
       
   271   };
   229   };
   272 
   230 
   273 
   231 
   274 } //END OF NAMESPACE LEMON
   232 } //END OF NAMESPACE LEMON
   275 
   233