Couenne  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
32  CouenneSolverInterface (CouenneCutGenerator *cg = NULL);
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 
76  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.
CouenneCutGenerator * cutgen_
The pointer to the Couenne cut generator.
virtual bool isProvenPrimalInfeasible() const
we need to overwrite this since we might have internal knowledge
bool isProvenDualInfeasible() const
set doingResolve_
bool knowOptimal_
Flag indicating that optimality was detected during solveFromHotStart.
virtual bool isProvenOptimal() const
we need to overwrite this since we might have internal knowledge
virtual int tightenBoundsCLP_Light(int lightweight)
Copy of the Clp version — light version.
virtual void initialSolve()
Solve initial LP relaxation.
virtual void solveFromHotStart()
Optimize starting from the hot start snapshot.
void setCutGenPtr(CouenneCutGenerator *cg)
Set cut generator pointer after setup, to avoid changes in the pointer due to cut generator cloning (...
virtual void resolve()
Resolve an LP relaxation after problem modification.
virtual void markHotStart()
Create a hot start snapshot of the optimization process.
virtual void unmarkHotStart()
Delete the hot start snapshot.
bool knowDualInfeasible_
Flag indicating this problem&#39;s continuous relaxation is unbounded.
CouenneCutGenerator * CutGen()
Return cut generator pointer.
CouenneSolverInterface(CouenneCutGenerator *cg=NULL)
Constructor.
virtual int tightenBounds(int lightweight)
Tighten bounds on all variables (including continuous).
bool knowInfeasible_
Flag indicating that infeasibility was detected during solveFromHotStart.
virtual int tightenBoundsCLP(int lightweight)
Copy of the Clp version — not light version.
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
virtual void resolve_nobt()
Resolve an LP without applying bound tightening beforehand.
virtual double getObjValue() const
Get the objective function value.