9 #ifndef BonOaDecBase_HPP
10 #define BonOaDecBase_HPP
12 #include "CglCutGenerator.hpp"
15 #include "CbcModel.hpp"
17 #include "CbcStrategy.hpp"
19 #include "CoinTime.hpp"
20 #include "OsiAuxInfo.hpp"
21 #include "OsiBranchingObject.hpp"
39 bool saveBasis=
true,
bool saveBounds=
false,
40 bool saveCutoff =
false,
bool resolve=
true);
50 OsiSolverInterface *
si()
64 OsiSolverInterface *
si_;
114 virtual void generateCuts(
const OsiSolverInterface &si, OsiCuts & cs,
115 const CglTreeInfo
info = CglTreeInfo());
229 virtual double performOa(OsiCuts &cs, solverManip &lpManip,
231 BabInfo * babInfo,
double &,
const CglTreeInfo &
info)
const = 0;
244 mutable OsiSolverInterface *
lp_;
279 bool checkInteger(
const OsiSolverInterface&nlp, std::ostream & os)
const;
281 void printEndOfProcedureDebugMessage(
const OsiCuts &cs,
287 std::ostream & os)
const;
OaDecompositionBase(BabSetupBase &b, bool leaveSiUnchanged, bool reassignLpsolver)
New usefull constructor.
int maxSols_
maximum number of solutions
Small class to manipulatee various things in an OsiSolverInterface and restore them.
int nLocalSearch_
number of local searches performed
void setObjects(OsiObject **objects, int nObjects)
Set objects.
const double * siColUpper_
Upper bounds on variables.
const double * siColLower_
Lower bounds on variables.
OsiCuts savedCuts_
Saved cuts: in some cases when using OA to check feasible solution algorithm may loop because Cbc rem...
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
void passInMessageHandler(CoinMessageHandler *handler)
void setLeaveSiUnchanged(bool yesno)
Set whether to leave the solverinterface unchanged.
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
bool reassignLpsolver_
Do we need to reassign the lp solver with Cbc.
bool addOnlyViolated_
Add only violated OA inequalities.
double maxLocalSearchTime_
maximum time for local searches
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())
Standard cut generation methods.
int initialNumberRows_
Initial number of rows (-1 if don't save).
OsiSolverInterface * lp_
A linear solver.
void setLogLevel(int level)
virtual bool doLocalSearch(BabInfo *babInfo) const =0
virutal method to decide if local search is performed
double cbcIntegerTolerance_
integer tolerance (has to be the same as Cbc's)
void setStrategy(const CbcStrategy &strategy)
Strategy to apply when using Cbc as MILP sub-solver.
void setReassignLpSolver(bool v)
void restore()
Restore solver.
OsiObject ** objects_
Some objects the feasiblitiy of which to verify.
bool global_
Add cuts as global.
solverManip(OsiSolverInterface *si, bool saveNumRows=true, bool saveBasis=true, bool saveBounds=false, bool saveCutoff=false, bool resolve=true)
Constructor.
CoinMessageHandler * handler_
messages handler.
double gap_tol_
setting for gap tolerance.
int nObjects_
Number of objects.*/.
void assignNlpInterface(OsiTMINLPInterface *nlp)
Assign an OsiTMINLPInterface.
double cutoff_
Initial cutoff.
void assignLpInterface(OsiSolverInterface *si)
Assign an OsiTMINLPInterface.
~solverManip()
Destructor.
A class to have all elements necessary to setup a branch-and-bound.
double timeBegin_
time of construction
void setupMipSolver(BabSetupBase &b, const std::string &prefix)
CoinWarmStart * warm_
Inital basis.
virtual ~OaDecompositionBase()
Destructor.
double * colLower_
Initial lower bounds.
Parameters parameters_
Parameters.
int currentNodeNumber_
Store the current node number.
int numSols_
number of solutions found by OA_decomposition.
double cbcCutoffIncrement_
cutoff min increase (has to be intialized trhough Cbc)
void getCached()
Number of columns.
int nSolve_
Number of nlp solved done.
int subMilpLogLevel_
sub milp log level.
bool leaveSiUnchanged_
Wether or not we should remove cuts at the end of the procedure.
double logFrequency_
Frequency of log.
CoinMessages messages_
Messages for OA.
int maxLocalSearch_
Total max number of local searches.
virtual double performOa(OsiCuts &cs, solverManip &lpManip, BabInfo *babInfo, double &, const CglTreeInfo &info) const =0
virtual method which performs the OA algorithm by modifying lp and nlp.
double * colUpper_
Initial Upper bounds.
BabSetupBase * s_
Pointer to setup.
OsiSolverInterface * si()
Get pointer to solver interface.
void setObjects(OsiObject **objects, int nObjects)
Set objects.
int numcols_
Number of columns.
const CbcStrategy * strategy() const
Base class for OA algorithms.
int numrows_
Number of rows.
int nObjects_
Number of objects.*/.
bool deleteSolver_
delete si_ ?
OsiObject ** objects_
Some objects the feasiblitiy of which to verify.
Parameters for algorithm.
OsiTMINLPInterface * nlp_
Pointer to nlp interface.
const Parameters & parameter() const
Parameters()
Constructor with default values.
Bonmin class for passing info between components of branch-and-cuts.
CbcStrategy * strategy_
Strategy to apply when using Cbc as MILP sub-solver.
bool post_nlp_solve(BabInfo *babInfo, double cutoff) const
Solve the nlp and do output.
OsiSolverInterface * si_
Interface saved.
bool isInteger(CouNumber x)
is this number integer?