00001 /* $Id: CouenneSolverInterface.hpp 769 2011-08-26 16:08:18Z pbelotti $ 00002 * 00003 * Name: CouenneSolverInterface.hpp 00004 * Authors: Pietro Belotti, Carnegie Mellon University 00005 * Purpose: OsiSolverInterface with a pointer to a CouenneCutGenerator object 00006 * 00007 * (C) Carnegie-Mellon University, 2007-09. 00008 * This file is licensed under the Eclipse Public License (EPL) 00009 */ 00010 00011 #ifndef COUENNESOLVERINTERFACE_HPP 00012 #define COUENNESOLVERINTERFACE_HPP 00013 00014 class OsiSolverInterface; 00015 00016 namespace Couenne { 00017 00018 class CouenneCutGenerator; 00019 00026 00027 template <class T> class CouenneSolverInterface: public T { 00028 00029 public: 00030 00032 CouenneSolverInterface (CouenneCutGenerator *cg = NULL); 00033 00035 CouenneSolverInterface (const CouenneSolverInterface &src); 00036 00038 ~CouenneSolverInterface (); 00039 00041 virtual OsiSolverInterface * clone (bool copyData = true) const 00042 {return new CouenneSolverInterface (*this);} 00043 00045 virtual bool isProvenPrimalInfeasible () const; 00046 00048 virtual bool isProvenOptimal () const; 00049 00051 CouenneCutGenerator *CutGen () 00052 {return cutgen_;} 00053 00057 void setCutGenPtr (CouenneCutGenerator *cg) { 00058 cutgen_ = cg; 00059 //if (cutgen_ && !(cutgen_ -> enableLpImpliedBounds ())) 00060 //specialOptions_ = specialOptions_ | 262144; 00061 } 00062 00064 virtual void initialSolve (); 00065 00067 virtual void resolve (); 00068 00070 virtual void resolve_nobt () 00071 {T::resolve ();} 00072 00076 00077 virtual void markHotStart(); 00078 00080 virtual void solveFromHotStart(); 00081 00083 virtual void unmarkHotStart(); 00085 00087 virtual int tightenBounds (int lightweight); 00088 00090 //bool &doingResolve () 00091 //{return doingResolve_;} 00092 00094 bool isProvenDualInfeasible () const; 00095 //{return knowDualInfeasible_;} 00096 00099 virtual double getObjValue() const; 00100 00101 protected: 00102 00104 virtual int tightenBoundsCLP (int lightweight); 00105 00107 virtual int tightenBoundsCLP_Light (int lightweight); 00108 00112 CouenneCutGenerator *cutgen_; 00113 00115 bool knowInfeasible_; 00116 00118 bool knowOptimal_; 00119 00121 bool knowDualInfeasible_; 00122 00125 //bool doingResolve_; 00126 }; 00127 00128 } 00129 00130 // These source files are #included due to the template classes 00131 // defined in there 00132 00133 #include "CouenneSolverInterface.cpp" 00134 #include "CouenneLPtightenBounds.cpp" 00135 #include "CouenneLPtightenBoundsCLP-light.cpp" 00136 #include "CouenneLPtightenBoundsCLP.cpp" 00137 00138 #endif