4 #include "OsiClpSolverInterface.hpp"
7 #include "CglGomory.hpp"
8 #include "CglProbing.hpp"
9 #include "CglKnapsackCover.hpp"
10 #include "CglOddHole.hpp"
11 #include "CglClique.hpp"
12 #include "CglFlowCover.hpp"
13 #include "CglMixedIntegerRounding2.hpp"
14 #include "CglTwomir.hpp"
15 #include "CglPreProcess.hpp"
16 #include "CglLandP.hpp"
17 #include "CglRedSplit.hpp"
24 s.
options()->GetIntegerValue(
"Gomory_cuts", freq,
"bonmin.");
28 CglGomory * gom =
new CglGomory;
30 gom->setLimitAtRoot(512);
32 cg->id =
"Mixed Integer Gomory";
36 s.
options()->GetIntegerValue(
"mir_cuts",freq,
"bonmin.");
40 CglMixedIntegerRounding2 * mir =
new CglMixedIntegerRounding2;
42 cg->id =
"Mixed Integer Rounding";
47 s.
options()->GetIntegerValue(
"2mir_cuts",freq,
"bonmin.");
51 CglTwomir * mir2 =
new CglTwomir;
56 s.
options()->GetIntegerValue(
"cover_cuts",freq,
"bonmin.");
60 CglKnapsackCover * cover =
new CglKnapsackCover;
66 s.
options()->GetIntegerValue(
"clique_cuts",freq,
"bonmin.");
70 CglClique * clique =
new CglClique;
71 clique->setStarCliqueReport(
false);
72 clique->setRowCliqueReport(
false);
73 clique->setMinViolation(0.1);
79 s.
options()->GetIntegerValue(
"flow_cover_cuts",freq,
"bonmin.");
83 CglFlowCover * flow =
new CglFlowCover;
85 cg->id =
"Flow Covers";
88 s.
options()->GetIntegerValue(
"lift_and_project_cuts",freq,
"bonmin.");
92 CglLandP * landp =
new CglLandP;
94 cg->id =
"Lift-and-Project";
97 s.
options()->GetIntegerValue(
"reduce_and_split_cuts",freq,
"bonmin.");
101 CglRedSplit * rands =
new CglRedSplit;
103 cg->id =
"Reduce-and-Split";
110 const CglTreeInfo
info) {
118 for(
int i = 0 ; i < 5 ; i++){
120 OsiClpSolverInterface si;
124 for(std::list<Coin::SmartPtr<CuttingMethod> >::const_iterator i =
methods_.begin() ;
126 (*i)->cgl->generateCuts(si, cuts, info);
128 std::vector<OsiRowCut *> mycuts(cuts.sizeRowCuts());
129 for(
int i = 0 ; i < cuts.sizeRowCuts() ; i++){
130 mycuts[i] = cuts.rowCutPtr(i);
131 cs.insert(*mycuts[i]);
133 nlp->applyRowCuts((
int)mycuts.size(),
const_cast<const OsiRowCut **
> (&mycuts[0]));
137 std::vector<int> kept;
139 int * del =
new int [numberRowsNow-numberRows];
145 CoinRelFltEq eq(1
e-06);
147 for (
int i=numberRowsNow -1;i>=numberRows;i--) {
148 if ( !(eq(activity[i], lb[i]) || eq(activity[i], ub[i])) )
149 cs.eraseRowCut(i - numberRows);
void fint fint fint real fint real real real real real real real real real fint real fint fint fint real fint fint fint fint * info
const TMINLP2TNLP * problem() const
get pointer to the TMINLP2TNLP adapter
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
virtual int getNumRows() const
Get number of rows.
A class to build outer approximations.
void generateCuts(const OsiSolverInterface &solver, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
void fint fint fint real fint real real real real real real real real real * e
A class to have all elements necessary to setup a branch-and-bound.
virtual void resolve()
Resolve the continuous relaxation after problem modification.
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
void fint fint fint fint fint fint fint fint fint fint real real real real real real real real * s
Type for cut generation method with its frequency and string identification.
std::list< Coin::SmartPtr< CuttingMethod > > methods_
void initialize(BabSetupBase &s)
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
OsiTMINLPInterface * nonlinearSolver()
Pointer to the non-linear solver used.
Ipopt::SmartPtr< Ipopt::OptionsList > options()
Acces list of Options.
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.