Changes in lemon/glpk.h [902:d2bc45e8f6f2:793:e4554cd6b2bf] in lemon
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/glpk.h
r902 r793 26 26 #include <lemon/lp_base.h> 27 27 28 // forward declaration 29 #if !defined _GLP_PROB && !defined GLP_PROB 30 #define _GLP_PROB 31 #define GLP_PROB 32 typedef struct { double _opaque_prob; } glp_prob; 33 /* LP/MIP problem object */ 34 #endif 35 28 36 namespace lemon { 29 37 30 namespace _solver_bits {31 class VoidPtr {32 private:33 void *_ptr;34 public:35 VoidPtr() : _ptr(0) {}36 37 template <typename T>38 VoidPtr(T* ptr) : _ptr(reinterpret_cast<void*>(ptr)) {}39 40 template <typename T>41 VoidPtr& operator=(T* ptr) {42 _ptr = reinterpret_cast<void*>(ptr);43 return *this;44 }45 46 template <typename T>47 operator T*() const { return reinterpret_cast<T*>(_ptr); }48 };49 }50 38 51 39 /// \brief Base interface for the GLPK LP and MIP solver … … 56 44 protected: 57 45 58 _solver_bits::VoidPtr lp; 46 typedef glp_prob LPX; 47 glp_prob* lp; 59 48 60 49 GlpkBase(); … … 135 124 136 125 ///Pointer to the underlying GLPK data structure. 137 _solver_bits::VoidPtrlpx() {return lp;}126 LPX *lpx() {return lp;} 138 127 ///Const pointer to the underlying GLPK data structure. 139 _solver_bits::VoidPtrlpx() const {return lp;}128 const LPX *lpx() const {return lp;} 140 129 141 130 ///Returns the constraint identifier understood by GLPK.
Note: See TracChangeset
for help on using the changeset viewer.