11 #ifndef COUENNE_DISJUNCTIVE_CUTS_HPP
12 #define COUENNE_DISJUNCTIVE_CUTS_HPP
14 #include "BonRegisteredOptions.hpp"
16 #include "OsiSolverInterface.hpp"
17 #include "CglConfig.h"
18 #include "CglCutGenerator.hpp"
19 #include "BonOsiTMINLPInterface.hpp"
20 #include "BonBabSetupBase.hpp"
21 #include "BonBabInfos.hpp"
22 #include "OsiChooseVariable.hpp"
28 class CouenneCutGenerator;
97 Bonmin::BabSetupBase *base = NULL,
99 OsiChooseVariable *bcv = NULL,
100 bool is_strong =
false,
121 const CglTreeInfo = CglTreeInfo ())
122 #if CGL_VERSION_MAJOR == 0 && CGL_VERSION_MINOR <= 57
132 {
return ConstPtr (
jnlst_);}
135 int getDisjunctions (std::vector <std::pair <OsiCuts *, OsiCuts *> > &disjunctions,
136 OsiSolverInterface &si,
138 const CglTreeInfo &info)
const;
142 OsiSolverInterface &si,
144 const CglTreeInfo &info)
const;
147 int generateDisjCuts (std::vector <std::pair <OsiCuts *, OsiCuts *> > &disjs,
148 OsiSolverInterface &si,
150 const CglTreeInfo &info)
const;
153 int checkDisjSide (OsiSolverInterface &si, OsiCuts *cuts)
const;
157 OsiCuts *left, OsiCuts *right,
158 CoinPackedVector &lower, CoinPackedVector &upper)
const;
167 CoinPackedVector &left,
168 CoinPackedVector &right,
169 CoinPackedVector merged)
const;
173 OsiCuts *cuts)
const;
177 OsiColCut *cut)
const;
182 OsiSolverInterface &si)
const;
196 register double *inverted) {
198 while (n--) *inverted++ = - *orig++;
206 register int displacement) {
208 *dst++ = *src++ + displacement;
Cut Generator for linear convexifications.
ConstJnlstPtr Jnlst() const
Provide Journalist.
JnlstPtr jnlst_
SmartPointer to the Journalist.
void OsiSI2MatrVec(CoinPackedMatrix &M, CoinPackedVector &r, OsiSolverInterface &si) const
int depthStopSeparate_
Depth of the BB tree where stop separation.
CouenneDisjCuts(Bonmin::OsiTMINLPInterface *minlp=NULL, Bonmin::BabSetupBase *base=NULL, CouenneCutGenerator *cg=NULL, OsiChooseVariable *bcv=NULL, bool is_strong=false, JnlstPtr journalist=NULL, const Ipopt::SmartPtr< Ipopt::OptionsList > options=NULL)
constructor
void generateCuts(const OsiSolverInterface &, OsiCuts &, const CglTreeInfo=CglTreeInfo()) const
the main CglCutGenerator
void CoinInvN(register const double *orig, register int n, register double *inverted)
invert all contents
bool activeCols_
only include active columns in CGLP
CouenneCutGenerator * couenneCG_
pointer to symbolic repr. of constraint, variables, and bounds
int numDisjunctions_
Number of disjunction to consider at each separation.
Bonmin::OsiTMINLPInterface * minlp_
nonlinear solver interface as used within Bonmin (used at first Couenne pass of each b&b node) ...
double objValue_
Record obj value at final point of CouenneConv.
double septime_
separation time (includes generation of problem)
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Add list of options to be read from file.
int OsiCuts2MatrVec(OsiSolverInterface *cglp, OsiCuts *cuts, int displRow, int displRhs) const
add CGLP columns to solver interface; return number of columns added (for later removal) ...
CouenneDisjCuts * clone() const
clone method (necessary for the abstract CglCutGenerator class)
int getBoxUnion(OsiSolverInterface &si, OsiCuts *left, OsiCuts *right, CoinPackedVector &lower, CoinPackedVector &upper) const
compute smallest box containing both left and right boxes.
int getDisjunctions(std::vector< std::pair< OsiCuts *, OsiCuts * > > &disjunctions, OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo &info) const
get all disjunctions
Cut Generator for linear convexifications.
int depthLevelling_
Depth of the BB tree where start decreasing number of objects.
int initDisjNumber_
Initial number of objects to use for generating cuts.
int nrootcuts_
number of cuts generated at the first call
~CouenneDisjCuts()
destructor
bool addPreviousCut_
add previous disj cut to current CGLP?
void CoinCopyDisp(register const int *src, register int num, register int *dst, register int displacement)
a CoinCopyN with a += on each element
int ntotalcuts_
total number of cuts generated
bool activeRows_
only include active rows in CGLP
CouenneCutGenerator * couenneCG() const
return pointer to symbolic problem
int checkDisjSide(OsiSolverInterface &si, OsiCuts *cuts) const
check if (column!) cuts compatible with solver interface
bool isBranchingStrong_
Is branchMethod_ referred to a strong branching scheme?
void applyColCuts(OsiSolverInterface &si, OsiCuts *cuts) const
our own applyColCuts
double cpuTime_
maximum CPU time
double initDisjPercentage_
Initial percentage of objects to use for generating cuts, in [0,1].
int generateDisjCuts(std::vector< std::pair< OsiCuts *, OsiCuts * > > &disjs, OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo &info) const
generate one disjunctive cut from one CGLP
OsiCuts * getSingleDisjunction(OsiSolverInterface &si) const
create single osicolcut disjunction
void mergeBoxes(int dir, CoinPackedVector &left, CoinPackedVector &right, CoinPackedVector merged) const
utility to merge vectors into one
int separateWithDisjunction(OsiCuts *cuts, OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo &info) const
separate couenne cuts on both sides of single disjunction
OsiChooseVariable * branchingMethod_
Branching scheme (if strong, we can use SB candidates)