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 
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
Couenne::CouenneSolverInterface::clone
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
Definition: CouenneSolverInterface.hpp:41
Couenne::CouenneSolverInterface::isProvenDualInfeasible
bool isProvenDualInfeasible() const
set doingResolve_
Couenne::CouenneSolverInterface::setCutGenPtr
void setCutGenPtr(CouenneCutGenerator *cg)
Set cut generator pointer after setup, to avoid changes in the pointer due to cut generator cloning (...
Definition: CouenneSolverInterface.hpp:57
Couenne::CouenneSolverInterface::tightenBounds
virtual int tightenBounds(int lightweight)
Tighten bounds on all variables (including continuous).
Couenne::CouenneSolverInterface::CouenneSolverInterface
CouenneSolverInterface(const CouenneSolverInterface &src)
Copy constructor.
Couenne::CouenneSolverInterface::isProvenPrimalInfeasible
virtual bool isProvenPrimalInfeasible() const
we need to overwrite this since we might have internal knowledge
Couenne::CouenneCutGenerator
Cut Generator for linear convexifications.
Definition: CouenneCutGenerator.hpp:49
Couenne::CouenneSolverInterface::knowInfeasible_
bool knowInfeasible_
Flag indicating that infeasibility was detected during solveFromHotStart.
Definition: CouenneSolverInterface.hpp:119
Couenne::CouenneSolverInterface::resolve_nobt
virtual void resolve_nobt()
Resolve an LP without applying bound tightening beforehand.
Definition: CouenneSolverInterface.hpp:70
Couenne::CouenneSolverInterface::tightenBoundsCLP_Light
virtual int tightenBoundsCLP_Light(int lightweight)
Copy of the Clp version — light version.
Couenne
general include file for different compilers
Definition: CouenneAggrProbing.hpp:24
Couenne::CouenneSolverInterface::solveFromHotStart
virtual void solveFromHotStart()
Optimize starting from the hot start snapshot.
Couenne::CouenneSolverInterface::getObjValue
virtual double getObjValue() const
Get the objective function value.
Couenne::CouenneSolverInterface::tightenBoundsCLP
virtual int tightenBoundsCLP(int lightweight)
Copy of the Clp version — not light version.
Couenne::CouenneSolverInterface::unmarkHotStart
virtual void unmarkHotStart()
Delete the hot start snapshot.
Couenne::CouenneSolverInterface::cutgen_
CouenneCutGenerator * cutgen_
The pointer to the Couenne cut generator.
Definition: CouenneSolverInterface.hpp:116
Couenne::CouenneSolverInterface::CouenneSolverInterface
CouenneSolverInterface(CouenneCutGenerator *cg=NULL)
Constructor.
Couenne::CouenneSolverInterface::markHotStart
virtual void markHotStart()
Create a hot start snapshot of the optimization process.
OsiSolverInterface
Couenne::CouenneSolverInterface::CutGen
CouenneCutGenerator * CutGen()
Return cut generator pointer.
Definition: CouenneSolverInterface.hpp:51
Couenne::CouenneSolverInterface::knowOptimal_
bool knowOptimal_
Flag indicating that optimality was detected during solveFromHotStart.
Definition: CouenneSolverInterface.hpp:122
Couenne::CouenneSolverInterface::initialSolve
virtual void initialSolve()
Solve initial LP relaxation.
Couenne::CouenneSolverInterface::resolve
virtual void resolve()
Resolve an LP relaxation after problem modification.
Couenne::CouenneSolverInterface::knowDualInfeasible_
bool knowDualInfeasible_
Flag indicating this problem's continuous relaxation is unbounded.
Definition: CouenneSolverInterface.hpp:125
Couenne::CouenneSolverInterface
Solver interface class with a pointer to a Couenne cut generator.
Definition: CouenneChooseStrong.hpp:21
Couenne::CouenneSolverInterface::isProvenOptimal
virtual bool isProvenOptimal() const
we need to overwrite this since we might have internal knowledge
Couenne::CouenneSolverInterface::~CouenneSolverInterface
~CouenneSolverInterface()
Destructor.