#include <BonOaDecBase.hpp>
Inheritance diagram for Bonmin::OaDecompositionBase:
Public Member Functions | |
OaDecompositionBase (OsiTMINLPInterface *nlp=NULL) | |
Old usefull constructor. | |
OaDecompositionBase (BabSetupBase &b, bool leaveSiUnchanged, bool reassignLpsolver) | |
New usefull constructor. | |
OaDecompositionBase (const OaDecompositionBase ©) | |
Copy constructor. | |
virtual | ~OaDecompositionBase () |
Destructor. | |
virtual void | generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) const |
Standard cut generation methods. | |
void | assignNlpInterface (OsiTMINLPInterface *nlp) |
Assign an OsiTMINLPInterface. | |
void | assignLpInterface (OsiSolverInterface *si) |
Assign an OsiTMINLPInterface. | |
bool | reassignLpsolver () |
void | setObjects (OsiObject **objects, int nObjects) |
Set objects. | |
void | setLeaveSiUnchanged (bool yesno) |
Set whether to leave the solverinterface unchanged. | |
Parameters & | parameter () |
const Parameters & | parameter () const |
void | setLogLevel (int level) |
void | passInMessageHandler (CoinMessageHandler *handler) |
Protected Member Functions | |
virtual double | performOa (OsiCuts &cs, solverManip &lpManip, SubMipSolver *&subMip, BabInfo *babInfo, double &, const CglTreeInfo &info) const =0 |
virtual method which performs the OA algorithm by modifying lp and nlp. | |
virtual bool | doLocalSearch (BabInfo *babInfo) const =0 |
virutal method to decide if local search is performed | |
Protected helper functions | |
bool | post_nlp_solve (BabInfo *babInfo, double cutoff) const |
Do update after an nlp has been solved. | |
Protected Attributes | |
Protected members | |
OsiTMINLPInterface * | nlp_ |
Pointer to nlp interface. | |
BabSetupBase * | s_ |
Pointer to setup. | |
int | nSolve_ |
Number of nlp solved done. | |
OsiSolverInterface * | lp_ |
A linear solver. | |
OsiObject ** | objects_ |
Some objects the feasiblitiy of which to verify. | |
int | nObjects_ |
Number of objects.*/. | |
int | nLocalSearch_ |
number of local searches performed | |
CoinMessageHandler * | handler_ |
messages handler. | |
CoinMessages | messages_ |
Messages for OA. | |
bool | leaveSiUnchanged_ |
Wether or not we should remove cuts at the end of the procedure. | |
bool | reassignLpsolver_ |
Do we need to reassign the lp solver with Cbc. | |
double | timeBegin_ |
time of construction | |
int | numSols_ |
number of solutions found by OA_decomposition. | |
Parameters | parameters_ |
Parameters. | |
OsiCuts | savedCuts_ |
Saved cuts: in some cases when using OA to check feasible solution algorithm may loop because Cbc removes inactive cuts. | |
int | currentNodeNumber_ |
Store the current node number. | |
Classes | |
struct | Parameters |
Parameters for algorithm. More... | |
class | solverManip |
Small class to manipulatee various things in an OsiSolverInterface and restore them. More... |
Definition at line 29 of file BonOaDecBase.hpp.
Bonmin::OaDecompositionBase::OaDecompositionBase | ( | OsiTMINLPInterface * | nlp = NULL |
) |
Bonmin::OaDecompositionBase::OaDecompositionBase | ( | BabSetupBase & | b, | |
bool | leaveSiUnchanged, | |||
bool | reassignLpsolver | |||
) |
New usefull constructor.
Definition at line 60 of file BonOaDecBase.cpp.
References Bonmin::OaDecompositionBase::Parameters::addOnlyViolated_, Bonmin::OaDecompositionBase::Parameters::cbcCutoffIncrement_, Bonmin::OaDecompositionBase::Parameters::cbcIntegerTolerance_, Bonmin::OaDecompositionBase::Parameters::global_, handler_, Bonmin::OaDecompositionBase::Parameters::logFrequency_, Bonmin::OaDecompositionBase::Parameters::maxSols_, messages_, Bonmin::BabSetupBase::options(), parameters_, Bonmin::BabSetupBase::prefix(), setLogLevel(), Bonmin::OaDecompositionBase::Parameters::subMilpLogLevel_, and timeBegin_.
Bonmin::OaDecompositionBase::OaDecompositionBase | ( | const OaDecompositionBase & | copy | ) |
Bonmin::OaDecompositionBase::~OaDecompositionBase | ( | ) | [virtual] |
void Bonmin::OaDecompositionBase::generateCuts | ( | const OsiSolverInterface & | si, | |
OsiCuts & | cs, | |||
const CglTreeInfo | info = CglTreeInfo() | |||
) | const [virtual] |
Standard cut generation methods.
Reimplemented in Bonmin::EcpCuts.
Definition at line 337 of file BonOaDecBase.cpp.
References Bonmin::BabInfo::babPtr(), Bonmin::OaDecompositionBase::Parameters::cbcIntegerTolerance_, Bonmin::OaDecompositionBase::solverManip::cloneOther(), currentNodeNumber_, doLocalSearch(), Bonmin::OsiTMINLPInterface::getColLower(), Bonmin::OsiTMINLPInterface::getColUpper(), Bonmin::OsiTMINLPInterface::getNumCols(), Bonmin::BabInfo::hasSolution(), Bonmin::integerFeasible(), isInteger(), leaveSiUnchanged_, lp_, Bonmin::Bab::model(), nlp_, nObjects_, numSols_, objects_, parameters_, performOa(), Bonmin::OaDecompositionBase::solverManip::restore(), savedCuts_, Bonmin::OsiTMINLPInterface::setColLower(), Bonmin::OsiTMINLPInterface::setColUpper(), Bonmin::OaDecompositionBase::solverManip::setObjects(), Bonmin::OaDecompositionBase::solverManip::si(), and Bonmin::OaDecompositionBase::Parameters::strategy().
void Bonmin::OaDecompositionBase::assignNlpInterface | ( | OsiTMINLPInterface * | nlp | ) | [inline] |
void Bonmin::OaDecompositionBase::assignLpInterface | ( | OsiSolverInterface * | si | ) | [inline] |
Assign an OsiTMINLPInterface.
Definition at line 142 of file BonOaDecBase.hpp.
References lp_.
Referenced by Bonmin::EcpCuts::EcpCuts(), Bonmin::MinlpFeasPump::MinlpFeasPump(), and Bonmin::OACutGenerator2::OACutGenerator2().
bool Bonmin::OaDecompositionBase::reassignLpsolver | ( | ) | [inline] |
void Bonmin::OaDecompositionBase::setObjects | ( | OsiObject ** | objects, | |
int | nObjects | |||
) | [inline] |
void Bonmin::OaDecompositionBase::setLeaveSiUnchanged | ( | bool | yesno | ) | [inline] |
Set whether to leave the solverinterface unchanged.
Definition at line 158 of file BonOaDecBase.hpp.
References leaveSiUnchanged_.
Parameters& Bonmin::OaDecompositionBase::parameter | ( | ) | [inline] |
Definition at line 214 of file BonOaDecBase.hpp.
References parameters_.
Referenced by Bonmin::EcpCuts::generateCuts(), Bonmin::MinlpFeasPump::MinlpFeasPump(), Bonmin::OACutGenerator2::OACutGenerator2(), Bonmin::OaFeasibilityChecker::performOa(), Bonmin::OACutGenerator2::performOa(), Bonmin::MinlpFeasPump::performOa(), and signal_handler().
const Parameters& Bonmin::OaDecompositionBase::parameter | ( | ) | const [inline] |
void Bonmin::OaDecompositionBase::setLogLevel | ( | int | level | ) | [inline] |
Definition at line 224 of file BonOaDecBase.hpp.
References handler_.
Referenced by OaDecompositionBase().
void Bonmin::OaDecompositionBase::passInMessageHandler | ( | CoinMessageHandler * | handler | ) |
Definition at line 251 of file BonOaDecBase.cpp.
References handler_.
Referenced by Bonmin::BonminSetup::initializeBHyb().
bool Bonmin::OaDecompositionBase::post_nlp_solve | ( | BabInfo * | babInfo, | |
double | cutoff | |||
) | const [protected] |
Do update after an nlp has been solved.
Definition at line 480 of file BonOaDecBase.cpp.
References Bonmin::FEASIBLE_NLP, Bonmin::OsiTMINLPInterface::getColSolution(), Bonmin::OsiTMINLPInterface::getIterationCount(), Bonmin::OsiTMINLPInterface::getNumCols(), Bonmin::OsiTMINLPInterface::getObjValue(), handler_, Bonmin::INFEASIBLE_NLP, Bonmin::OsiTMINLPInterface::isAbandoned(), Bonmin::OsiTMINLPInterface::isIterationLimitReached(), Bonmin::OsiTMINLPInterface::isProvenOptimal(), messages_, nlp_, nSolve_, timeBegin_, and Bonmin::UPDATE_UB.
Referenced by Bonmin::OaFeasibilityChecker::performOa(), Bonmin::OACutGenerator2::performOa(), and Bonmin::MinlpFeasPump::performOa().
virtual double Bonmin::OaDecompositionBase::performOa | ( | OsiCuts & | cs, | |
solverManip & | lpManip, | |||
SubMipSolver *& | subMip, | |||
BabInfo * | babInfo, | |||
double & | , | |||
const CglTreeInfo & | info | |||
) | const [protected, pure virtual] |
virtual method which performs the OA algorithm by modifying lp and nlp.
Referenced by generateCuts().
virtual bool Bonmin::OaDecompositionBase::doLocalSearch | ( | BabInfo * | babInfo | ) | const [protected, pure virtual] |
virutal method to decide if local search is performed
Implemented in Bonmin::EcpCuts, Bonmin::MinlpFeasPump, Bonmin::OACutGenerator2, and Bonmin::OaFeasibilityChecker.
Referenced by generateCuts().
OsiTMINLPInterface* Bonmin::OaDecompositionBase::nlp_ [mutable, protected] |
Pointer to nlp interface.
Definition at line 248 of file BonOaDecBase.hpp.
Referenced by assignNlpInterface(), generateCuts(), Bonmin::EcpCuts::generateCuts(), Bonmin::OaFeasibilityChecker::performOa(), Bonmin::OACutGenerator2::performOa(), Bonmin::MinlpFeasPump::performOa(), post_nlp_solve(), and Bonmin::MinlpFeasPump::set_fp_objective().
BabSetupBase* Bonmin::OaDecompositionBase::s_ [protected] |
int Bonmin::OaDecompositionBase::nSolve_ [mutable, protected] |
Number of nlp solved done.
Definition at line 252 of file BonOaDecBase.hpp.
Referenced by post_nlp_solve().
OsiSolverInterface* Bonmin::OaDecompositionBase::lp_ [mutable, protected] |
A linear solver.
Definition at line 254 of file BonOaDecBase.hpp.
Referenced by assignLpInterface(), Bonmin::EcpCuts::doEcpRounds(), generateCuts(), and Bonmin::EcpCuts::generateCuts().
OsiObject* * Bonmin::OaDecompositionBase::objects_ [protected] |
Some objects the feasiblitiy of which to verify.
Definition at line 256 of file BonOaDecBase.hpp.
Referenced by generateCuts(), Bonmin::OaFeasibilityChecker::performOa(), Bonmin::OACutGenerator2::performOa(), Bonmin::MinlpFeasPump::performOa(), Bonmin::MinlpFeasPump::set_fp_objective(), and setObjects().
int Bonmin::OaDecompositionBase::nObjects_ [protected] |
Number of objects.*/.
Definition at line 258 of file BonOaDecBase.hpp.
Referenced by generateCuts(), Bonmin::OaFeasibilityChecker::performOa(), Bonmin::OACutGenerator2::performOa(), Bonmin::MinlpFeasPump::performOa(), Bonmin::MinlpFeasPump::set_fp_objective(), and setObjects().
int Bonmin::OaDecompositionBase::nLocalSearch_ [mutable, protected] |
number of local searches performed
Definition at line 260 of file BonOaDecBase.hpp.
Referenced by Bonmin::OACutGenerator2::doLocalSearch(), Bonmin::MinlpFeasPump::doLocalSearch(), Bonmin::OACutGenerator2::performOa(), and Bonmin::MinlpFeasPump::performOa().
CoinMessageHandler* Bonmin::OaDecompositionBase::handler_ [protected] |
messages handler.
Definition at line 262 of file BonOaDecBase.hpp.
Referenced by OaDecompositionBase(), passInMessageHandler(), Bonmin::OACutGenerator2::performOa(), Bonmin::MinlpFeasPump::performOa(), post_nlp_solve(), setLogLevel(), and ~OaDecompositionBase().
CoinMessages Bonmin::OaDecompositionBase::messages_ [protected] |
Messages for OA.
Definition at line 264 of file BonOaDecBase.hpp.
Referenced by OaDecompositionBase(), Bonmin::OACutGenerator2::performOa(), Bonmin::MinlpFeasPump::performOa(), and post_nlp_solve().
bool Bonmin::OaDecompositionBase::leaveSiUnchanged_ [protected] |
Wether or not we should remove cuts at the end of the procedure.
Definition at line 266 of file BonOaDecBase.hpp.
Referenced by Bonmin::EcpCuts::doEcpRounds(), generateCuts(), and setLeaveSiUnchanged().
bool Bonmin::OaDecompositionBase::reassignLpsolver_ [protected] |
Do we need to reassign the lp solver with Cbc.
Definition at line 268 of file BonOaDecBase.hpp.
Referenced by reassignLpsolver().
double Bonmin::OaDecompositionBase::timeBegin_ [protected] |
time of construction
Definition at line 270 of file BonOaDecBase.hpp.
Referenced by Bonmin::OACutGenerator2::doLocalSearch(), Bonmin::MinlpFeasPump::doLocalSearch(), OaDecompositionBase(), Bonmin::OACutGenerator2::performOa(), Bonmin::MinlpFeasPump::performOa(), and post_nlp_solve().
int Bonmin::OaDecompositionBase::numSols_ [mutable, protected] |
number of solutions found by OA_decomposition.
Definition at line 272 of file BonOaDecBase.hpp.
Referenced by Bonmin::OACutGenerator2::doLocalSearch(), Bonmin::MinlpFeasPump::doLocalSearch(), generateCuts(), Bonmin::OACutGenerator2::performOa(), and Bonmin::MinlpFeasPump::performOa().
Parameters Bonmin::OaDecompositionBase::parameters_ [protected] |
Definition at line 275 of file BonOaDecBase.hpp.
Referenced by Bonmin::OACutGenerator2::doLocalSearch(), Bonmin::MinlpFeasPump::doLocalSearch(), generateCuts(), OaDecompositionBase(), parameter(), Bonmin::OaFeasibilityChecker::performOa(), Bonmin::OACutGenerator2::performOa(), Bonmin::MinlpFeasPump::performOa(), Bonmin::OACutGenerator2::setStrategy(), and Bonmin::MinlpFeasPump::setStrategy().
OsiCuts Bonmin::OaDecompositionBase::savedCuts_ [mutable, protected] |
Saved cuts: in some cases when using OA to check feasible solution algorithm may loop because Cbc removes inactive cuts.
To overcome this we can impose that no OA cut can be discarded by Cbc but this consumes too much memory in some cases. Here we do it another way: cuts generated at current node are saved if algorithm seems to enter a loop we impose the needed cuts to be kept.
Definition at line 280 of file BonOaDecBase.hpp.
Referenced by generateCuts(), and Bonmin::OaFeasibilityChecker::performOa().
int Bonmin::OaDecompositionBase::currentNodeNumber_ [mutable, protected] |
Store the current node number.
Definition at line 282 of file BonOaDecBase.hpp.
Referenced by generateCuts().