lemon/glpk.h
changeset 538 ba124394367a
parent 537 0fec6a017ead
child 542 fc6c7aab4b8d
equal deleted inserted replaced
2:4fc11560499f 3:709655f2a5dc
    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 
   102 
   103   public:
   103   private:
   104 
   104 
   105     /// \brief Deallocates the globally allocated memory of GLPK.
       
   106 
       
   107     /// Deallocates the globally allocated memory of GLPK.  \note
       
   108     /// Usually, it do not have to be called, because the GLPK use
       
   109     /// only a small amount of global memory, and it is deallocated
       
   110     /// automatically at the end of program.
       
   111     static void freeEnv();
   105     static void freeEnv();
       
   106 
       
   107     struct FreeEnvHelper {
       
   108       ~FreeEnvHelper() {
       
   109         freeEnv();
       
   110       }
       
   111     };
       
   112     
       
   113     static FreeEnvHelper freeEnvHelper;
       
   114     
       
   115   public:
   112 
   116 
   113     ///Pointer to the underlying GLPK data structure.
   117     ///Pointer to the underlying GLPK data structure.
   114     LPX *lpx() {return lp;}
   118     LPX *lpx() {return lp;}
   115     ///Const pointer to the underlying GLPK data structure.
   119     ///Const pointer to the underlying GLPK data structure.
   116     const LPX *lpx() const {return lp;}
   120     const LPX *lpx() const {return lp;}