11 #ifndef COUENNE_CUT_GENERATOR_HPP
12 #define COUENNE_CUT_GENERATOR_HPP
17 #include "CglConfig.h"
18 #include "CglCutGenerator.hpp"
19 #include "OsiRowCut.hpp"
22 #include "OsiSolverInterface.hpp"
28 template <
class T>
class SmartPtr;
34 class RegisteredOptions;
36 class OsiTMINLPInterface;
116 struct ASL * = NULL);
158 const CglTreeInfo = CglTreeInfo ())
159 #if CGL_VERSION_MAJOR == 0 && CGL_VERSION_MINOR <= 57
233 void genRowCuts (
const OsiSolverInterface &, OsiCuts &cs,
237 void genColCuts (
const OsiSolverInterface &, OsiCuts &,
int,
int *)
const;
267 void sparse2dense (
int ncols, t_chg_bounds *chg_bds,
int *&changed,
int &nchanged);
Cut Generator for linear convexifications.
bool firstcall_
True if no convexification cuts have been generated yet for this problem.
bool addviolated_
True if we should add the violated cuts only, false if all of them should be added.
Bonmin::OsiTMINLPInterface * nlp_
nonlinear solver interface as used within Bonmin (used at first Couenne pass of each b&b node ...
ConstJnlstPtr Jnlst() const
Provide Journalist.
CouenneCutGenerator(Bonmin::OsiTMINLPInterface *=NULL, Bonmin::BabSetupBase *base=NULL, CouenneProblem *=NULL, struct ASL *=NULL)
constructor
~CouenneCutGenerator()
destructor
int lastPrintLine
Running count of printed info lines.
status of lower/upper bound of a variable, to be checked/modified in bound tightening ...
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
enum conv_type convtype_
what kind of sampling should be performed?
void addEnvelope(OsiCuts &, int, unary_function, unary_function, int, int, CouNumber, CouNumber, CouNumber, t_chg_bounds *=NULL, bool=false) const
Add general linear envelope to convex function, given its variables' indices, the (univariate) functi...
double objValue_
Record obj value at final point of CouenneConv.
bool check_lp_
Check all generated LPs through an independent call to OsiClpSolverInterface::initialSolve() ...
enum conv_type ConvType() const
get convexification type (see CouenneTypes.h)
bool check_lp() const
return check_lp flag (used in CouenneSolverInterface)
void getStats(int &nrc, int &ntc, double &st)
Get statistics.
JnlstPtr jnlst_
SmartPointer to the Journalist.
bool enableLpImpliedBounds() const
returns value of enable_lp_implied_bounds_
double septime_
separation time (includes generation of problem)
CouenneProblem * Problem() const
return pointer to symbolic problem
void printLineInfo() const
print node, depth, LB/UB/LP info
void sparse2dense(int ncols, t_chg_bounds *chg_bds, int *&changed, int &nchanged)
translate sparse to dense vector (should be replaced)
int addTangent(OsiCuts &, int, int, CouNumber, CouNumber, CouNumber, int) const
add tangent at given poing (x,w) with given slope
double & rootTime()
Time spent at root node.
A class to have all elements necessary to setup a branch-and-bound.
void setBabPtr(Bonmin::Bab *p)
Method to set the Bab pointer.
CouNumber(* unary_function)(CouNumber)
unary function, used in all exprUnary
int createCut(OsiCuts &, CouNumber, CouNumber, int, CouNumber, int=-1, CouNumber=0., int=-1, CouNumber=0., bool=false) const
create cut and check violation. Insert and return status
Class for MINLP problems with symbolic information.
OSSmartPtr< const U > ConstPtr(const OSSmartPtr< U > &smart_ptr)
bool isFirst() const
has generateCuts been called yet?
bool enable_lp_implied_bounds_
Take advantage of OsiClpSolverInterface::tightenBounds (), known to have caused some problems some ti...
void setJnlst(JnlstPtr jnlst__)
int nSamples() const
get number of convexification samples
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Add list of options to be read from file.
void setProblem(CouenneProblem *p)
return pointer to symbolic problem
bool & infeasNode() const
Allow to get and set the infeasNode_ flag (used only in generateCuts())
double CouNumber
main number type in Couenne
void genRowCuts(const OsiSolverInterface &, OsiCuts &cs, int, int *, t_chg_bounds *=NULL) const
generate OsiRowCuts for current convexification
int getnvars() const
total number of variables (original + auxiliary)
bool infeasNode_
signal infeasibility of current node (found through bound tightening)
Bonmin::Bab * BabPtr_
pointer to the Bab object (used to retrieve the current primal bound through bestObj()) ...
CouenneProblem * problem_
pointer to symbolic repr. of constraint, variables, and bounds
CouenneCutGenerator * clone() const
clone method (necessary for the abstract CglCutGenerator class)
double rootTime_
Time spent at the root node.
void genColCuts(const OsiSolverInterface &, OsiCuts &, int, int *) const
generate OsiColCuts for improved (implied and propagated) bounds
int ntotalcuts_
total number of cuts generated
bool addViolated() const
should we add the violated cuts only (true), or all of them (false)?
int addSegment(OsiCuts &, int, int, CouNumber, CouNumber, CouNumber, CouNumber, int) const
Add half-plane through (x1,y1) and (x2,y2) – resp.
int nrootcuts_
number of cuts generated at the first call
void generateCuts(const OsiSolverInterface &, OsiCuts &, const CglTreeInfo=CglTreeInfo()) const
the main CglCutGenerator
conv_type
position and number of convexification cuts added for a lower convex (upper concave) envelope ...
int nSamples_
how many cuts should be added for each function?