#include <BonNlpHeuristic.hpp>
Collaboration diagram for Couenne::NlpSolveHeuristic:
Public Member Functions | |
NlpSolveHeuristic () | |
Default constructor. | |
NlpSolveHeuristic (CbcModel &mip, Bonmin::OsiTMINLPInterface &nlp, bool cloneNlp=false, CouenneProblem *couenne=NULL) | |
Constructor with model and Ipopt problems. | |
NlpSolveHeuristic (const NlpSolveHeuristic &other) | |
Copy constructor. | |
virtual | ~NlpSolveHeuristic () |
Destructor. | |
virtual CbcHeuristic * | clone () const |
Clone. | |
NlpSolveHeuristic & | operator= (const NlpSolveHeuristic &rhs) |
Assignment operator. | |
void | setNlp (Bonmin::OsiTMINLPInterface &nlp, bool cloneNlp=true) |
Set the nlp solver. | |
void | setCouenneProblem (CouenneProblem *) |
set the couenne problem to use. | |
virtual void | resetModel (CbcModel *model) |
Does nothing. | |
virtual int | solution (double &objectiveValue, double *newSolution) |
Run heuristic, return 1 if a better solution than the one passed is found and 0 otherwise. | |
void | setMaxNlpInf (double value) |
set maxNlpInf. | |
void | setNumberSolvePerLevel (int value) |
set number of nlp's solved for each given level of the tree | |
Static Public Member Functions | |
static void | registerOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions >) |
initialize options | |
Private Attributes | |
Bonmin::OsiTMINLPInterface * | nlp_ |
Pointer to an nlp solver interface. | |
bool | hasCloned_ |
is nlp_ cloned or just a pointer? | |
double | maxNlpInf_ |
maximum nlp infeasibility under which try to solve problem with Ipopt. | |
int | numberSolvePerLevel_ |
Number of nlp's solved for each given level of the tree. | |
CouenneProblem * | couenne_ |
Pointer to a couenne representation of the problem. |
Definition at line 28 of file BonNlpHeuristic.hpp.
NlpSolveHeuristic::NlpSolveHeuristic | ( | ) |
NlpSolveHeuristic::NlpSolveHeuristic | ( | CbcModel & | mip, | |
Bonmin::OsiTMINLPInterface & | nlp, | |||
bool | cloneNlp = false , |
|||
CouenneProblem * | couenne = NULL | |||
) |
Constructor with model and Ipopt problems.
Definition at line 38 of file BonNlpHeuristic.cpp.
References Bonmin::OsiTMINLPInterface::clone(), and nlp_.
NlpSolveHeuristic::NlpSolveHeuristic | ( | const NlpSolveHeuristic & | other | ) |
Copy constructor.
Definition at line 47 of file BonNlpHeuristic.cpp.
References Bonmin::OsiTMINLPInterface::clone(), hasCloned_, and nlp_.
NlpSolveHeuristic::~NlpSolveHeuristic | ( | ) | [virtual] |
CbcHeuristic * NlpSolveHeuristic::clone | ( | ) | const [virtual] |
NlpSolveHeuristic & NlpSolveHeuristic::operator= | ( | const NlpSolveHeuristic & | rhs | ) |
Assignment operator.
Definition at line 63 of file BonNlpHeuristic.cpp.
References couenne_, hasCloned_, maxNlpInf_, nlp_, and numberSolvePerLevel_.
void NlpSolveHeuristic::setNlp | ( | Bonmin::OsiTMINLPInterface & | nlp, | |
bool | cloneNlp = true | |||
) |
Set the nlp solver.
Definition at line 90 of file BonNlpHeuristic.cpp.
References Bonmin::OsiTMINLPInterface::clone(), hasCloned_, and nlp_.
Referenced by Couenne::CouenneSetup::InitializeCouenne().
void NlpSolveHeuristic::setCouenneProblem | ( | CouenneProblem * | ) |
set the couenne problem to use.
Definition at line 101 of file BonNlpHeuristic.cpp.
References couenne_.
Referenced by Couenne::CouenneSetup::InitializeCouenne().
virtual void Couenne::NlpSolveHeuristic::resetModel | ( | CbcModel * | model | ) | [inline, virtual] |
int NlpSolveHeuristic::solution | ( | double & | objectiveValue, | |
double * | newSolution | |||
) | [virtual] |
Run heuristic, return 1 if a better solution than the one passed is found and 0 otherwise.
objectiveValue Best known solution in input and value of solution found in output newSolution Solution found by heuristic.
Definition at line 106 of file BonNlpHeuristic.cpp.
References Couenne::CouenneProblem::checkNLP2(), couenne_, COUENNE_EPS, COUENNE_INFINITY, e, Couenne::CouenneProblem::getFeasTol(), Couenne::CouenneRecordBestSol::getModSolVal(), Bonmin::OsiTMINLPInterface::getNumCols(), Couenne::CouenneProblem::getRecordBestSol(), Bonmin::AuxInfo::infeasibleNode(), info, Couenne::J_COUENNE(), maxNlpInf_, nlp_, numberSolvePerLevel_, Bonmin::OsiTMINLPInterface::setColLower(), Bonmin::OsiTMINLPInterface::setColUpper(), Bonmin::AuxInfo::setHasNlpSolution(), Bonmin::AuxInfo::setNlpSolution(), and Couenne::CouenneRecordBestSol::update().
void Couenne::NlpSolveHeuristic::setMaxNlpInf | ( | double | value | ) | [inline] |
set maxNlpInf.
Definition at line 61 of file BonNlpHeuristic.hpp.
References maxNlpInf_.
Referenced by Couenne::CouenneSetup::InitializeCouenne().
void Couenne::NlpSolveHeuristic::setNumberSolvePerLevel | ( | int | value | ) | [inline] |
set number of nlp's solved for each given level of the tree
Definition at line 64 of file BonNlpHeuristic.hpp.
References numberSolvePerLevel_.
Referenced by Couenne::CouenneSetup::InitializeCouenne().
void NlpSolveHeuristic::registerOptions | ( | Ipopt::SmartPtr< Bonmin::RegisteredOptions > | ) | [static] |
initialize options
Definition at line 431 of file BonNlpHeuristic.cpp.
Referenced by Couenne::CouenneSetup::registerAllOptions().
Pointer to an nlp solver interface.
Definition at line 72 of file BonNlpHeuristic.hpp.
Referenced by NlpSolveHeuristic(), operator=(), setNlp(), solution(), and ~NlpSolveHeuristic().
bool Couenne::NlpSolveHeuristic::hasCloned_ [private] |
is nlp_ cloned or just a pointer?
Definition at line 74 of file BonNlpHeuristic.hpp.
Referenced by NlpSolveHeuristic(), operator=(), setNlp(), and ~NlpSolveHeuristic().
double Couenne::NlpSolveHeuristic::maxNlpInf_ [private] |
maximum nlp infeasibility under which try to solve problem with Ipopt.
Definition at line 76 of file BonNlpHeuristic.hpp.
Referenced by operator=(), setMaxNlpInf(), and solution().
int Couenne::NlpSolveHeuristic::numberSolvePerLevel_ [private] |
Number of nlp's solved for each given level of the tree.
Definition at line 78 of file BonNlpHeuristic.hpp.
Referenced by operator=(), setNumberSolvePerLevel(), and solution().
Pointer to a couenne representation of the problem.
Definition at line 80 of file BonNlpHeuristic.hpp.
Referenced by operator=(), setCouenneProblem(), and solution().