Couenne  0.5.8
CouenneSolverInterface.hpp
Go to the documentation of this file.
1 /* $Id: CouenneSolverInterface.hpp 833 2012-02-11 14:09:50Z pbelotti $
2  *
3  * Name: CouenneSolverInterface.hpp
4  * Authors: Pietro Belotti, Carnegie Mellon University
5  * Purpose: OsiSolverInterface with a pointer to a CouenneCutGenerator object
6  *
7  * (C) Carnegie-Mellon University, 2007-09.
8  * This file is licensed under the Eclipse Public License (EPL)
9  */
10 
11 #ifndef COUENNESOLVERINTERFACE_HPP
12 #define COUENNESOLVERINTERFACE_HPP
13 
14 class OsiSolverInterface;
15 
16 namespace Couenne {
17 
18 class CouenneCutGenerator;
19 
26 
27 template <class T> class CouenneSolverInterface: public T {
28 
29 public:
30 
33 
36 
39 
41  virtual OsiSolverInterface * clone (bool copyData = true) const
42  {return new CouenneSolverInterface (*this);}
43 
45  virtual bool isProvenPrimalInfeasible () const;
46 
48  virtual bool isProvenOptimal () const;
49 
52  {return cutgen_;}
53 
58  cutgen_ = cg;
59  //if (cutgen_ && !(cutgen_ -> enableLpImpliedBounds ()))
60  //specialOptions_ = specialOptions_ | 262144;
61  }
62 
64  virtual void initialSolve ();
65 
67  virtual void resolve ();
68 
70  virtual void resolve_nobt ()
71  {T::resolve ();}
72 
77  virtual void markHotStart();
78 
80  virtual void solveFromHotStart();
81 
83  virtual void unmarkHotStart();
85 
87  virtual int tightenBounds (int lightweight);
88 
90  //bool &doingResolve ()
91  //{return doingResolve_;}
92 
94  bool isProvenDualInfeasible () const;
95  //{return knowDualInfeasible_;}
96 
99  virtual double getObjValue() const;
100 
101  // /// returns LP optimum at root node
102  // double rootLB () const
103  // {return rootLB_;}
104 
105 protected:
106 
108  virtual int tightenBoundsCLP (int lightweight);
109 
111  virtual int tightenBoundsCLP_Light (int lightweight);
112 
117 
120 
123 
126 
127  // /// First (root) LP not solved yet -- use this flag to obtain root
128  // /// lower bound and print an alternative gap
129  // bool beforeFirstRootLP_;
130 
131  // /// First (root) LP bound -- used to get an alternative gap
132  // double rootLB_;
133 };
134 
135 }
136 
137 // These source files are #included due to the template classes
138 // defined in there
139 
140 #include "CouenneSolverInterface.cpp"
141 #include "CouenneLPtightenBounds.cpp"
142 #include "CouenneLPtightenBoundsCLP-light.cpp"
143 #include "CouenneLPtightenBoundsCLP.cpp"
144 
145 #endif
Cut Generator for linear convexifications.
Solver interface class with a pointer to a Couenne cut generator.
virtual int tightenBoundsCLP(int lightweight)
Copy of the Clp version — not light version.
bool knowOptimal_
Flag indicating that optimality was detected during solveFromHotStart.
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
virtual int tightenBoundsCLP_Light(int lightweight)
Copy of the Clp version — light version.
virtual void resolve()
Resolve an LP relaxation after problem modification.
virtual int tightenBounds(int lightweight)
Tighten bounds on all variables (including continuous).
virtual bool isProvenPrimalInfeasible() const
we need to overwrite this since we might have internal knowledge
virtual void markHotStart()
Create a hot start snapshot of the optimization process.
bool isProvenDualInfeasible() const
set doingResolve_
CouenneCutGenerator * cutgen_
The pointer to the Couenne cut generator.
virtual void initialSolve()
Solve initial LP relaxation.
CouenneCutGenerator * CutGen()
Return cut generator pointer.
bool knowDualInfeasible_
Flag indicating this problem's continuous relaxation is unbounded.
virtual double getObjValue() const
Get the objective function value.
void setCutGenPtr(CouenneCutGenerator *cg)
Set cut generator pointer after setup, to avoid changes in the pointer due to cut generator cloning (...
virtual void solveFromHotStart()
Optimize starting from the hot start snapshot.
virtual void unmarkHotStart()
Delete the hot start snapshot.
CouenneSolverInterface(CouenneCutGenerator *cg=NULL)
Constructor.
virtual bool isProvenOptimal() const
we need to overwrite this since we might have internal knowledge
CouenneSolverInterface(const CouenneSolverInterface &src)
Copy constructor.
virtual void resolve_nobt()
Resolve an LP without applying bound tightening beforehand.
bool knowInfeasible_
Flag indicating that infeasibility was detected during solveFromHotStart.
general include file for different compilers