#include <CbcHeuristic.hpp>
Inheritance diagram for CbcHeuristic:
Public Member Functions | |
CbcHeuristic () | |
CbcHeuristic (CbcModel &model) | |
virtual | ~CbcHeuristic () |
virtual void | setModel (CbcModel *model) |
update model (This is needed if cliques update matrix etc) | |
virtual CbcHeuristic * | clone () const =0 |
Clone. | |
virtual void | resetModel (CbcModel *model)=0 |
Resets stuff if model changes. | |
virtual int | solution (double &objectiveValue, double *newSolution)=0 |
returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets solution values if good, sets objective value This is called after cuts have been added - so can not add cuts | |
virtual int | solution (double &objectiveValue, double *newSolution, OsiCuts &cs) |
returns 0 if no solution, 1 if valid solution, -1 if just returning an estimate of best possible solution with better objective value than one passed in Sets solution values if good, sets objective value (only if nonzero code) This is called at same time as cut generators - so can add cuts Default is do nothing | |
virtual void | validate () |
Validate model i.e. sets when_ to 0 if necessary (may be NULL). | |
void | setWhen (int value) |
Sets "when" flag - 0 off, 1 at root, 2 other than root, 3 always. | |
int | when () const |
Gets "when" flag - 0 off, 1 at root, 2 other than root, 3 always. | |
int | smallBranchAndBound (OsiSolverInterface *solver, int numberNodes, double *newSolution, double &newSolutionValue, double cutoff, std::string name) const |
Do mini branch and bound (return 1 if solution). | |
virtual void | generateCpp (FILE *fp) |
Create C++ lines to get to current state. | |
Protected Attributes | |
CbcModel * | model_ |
Model. | |
int | when_ |
When flag - 0 off, 1 at root, 2 other than root, 3 always. | |
Private Member Functions | |
CbcHeuristic & | operator= (const CbcHeuristic &rhs) |
Illegal Assignment operator. |
Definition at line 18 of file CbcHeuristic.hpp.
CbcHeuristic::CbcHeuristic | ( | ) |
CbcHeuristic::CbcHeuristic | ( | CbcModel & | model | ) |
virtual CbcHeuristic::~CbcHeuristic | ( | ) | [virtual] |
virtual void CbcHeuristic::setModel | ( | CbcModel * | model | ) | [virtual] |
update model (This is needed if cliques update matrix etc)
Reimplemented in CbcRounding, CbcSerendipity, CbcHeuristicFPump, CbcHeuristicGreedyCover, CbcHeuristicGreedyEquality, and CbcHeuristicLocal.
virtual CbcHeuristic* CbcHeuristic::clone | ( | ) | const [pure virtual] |
Clone.
Implemented in CbcRounding, CbcSerendipity, CbcHeuristicFPump, CbcHeuristicGreedyCover, CbcHeuristicGreedyEquality, and CbcHeuristicLocal.
virtual void CbcHeuristic::resetModel | ( | CbcModel * | model | ) | [pure virtual] |
Resets stuff if model changes.
Implemented in CbcRounding, CbcSerendipity, CbcHeuristicFPump, CbcHeuristicGreedyCover, CbcHeuristicGreedyEquality, and CbcHeuristicLocal.
virtual int CbcHeuristic::solution | ( | double & | objectiveValue, | |
double * | newSolution | |||
) | [pure virtual] |
returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets solution values if good, sets objective value This is called after cuts have been added - so can not add cuts
Implemented in CbcRounding, CbcSerendipity, CbcHeuristicFPump, CbcHeuristicGreedyCover, CbcHeuristicGreedyEquality, and CbcHeuristicLocal.
virtual int CbcHeuristic::solution | ( | double & | objectiveValue, | |
double * | newSolution, | |||
OsiCuts & | cs | |||
) | [inline, virtual] |
returns 0 if no solution, 1 if valid solution, -1 if just returning an estimate of best possible solution with better objective value than one passed in Sets solution values if good, sets objective value (only if nonzero code) This is called at same time as cut generators - so can add cuts Default is do nothing
Definition at line 52 of file CbcHeuristic.hpp.
virtual void CbcHeuristic::validate | ( | ) | [inline, virtual] |
Validate model i.e. sets when_ to 0 if necessary (may be NULL).
Reimplemented in CbcRounding, CbcHeuristicGreedyCover, and CbcHeuristicGreedyEquality.
Definition at line 57 of file CbcHeuristic.hpp.
void CbcHeuristic::setWhen | ( | int | value | ) | [inline] |
Sets "when" flag - 0 off, 1 at root, 2 other than root, 3 always.
If 10 added then don't worry if validate says there are funny objects as user knows it will be fine
Definition at line 63 of file CbcHeuristic.hpp.
References when_.
int CbcHeuristic::when | ( | ) | const [inline] |
Gets "when" flag - 0 off, 1 at root, 2 other than root, 3 always.
Definition at line 66 of file CbcHeuristic.hpp.
References when_.
int CbcHeuristic::smallBranchAndBound | ( | OsiSolverInterface * | solver, | |
int | numberNodes, | |||
double * | newSolution, | |||
double & | newSolutionValue, | |||
double | cutoff, | |||
std::string | name | |||
) | const |
Do mini branch and bound (return 1 if solution).
virtual void CbcHeuristic::generateCpp | ( | FILE * | fp | ) | [inline, virtual] |
Create C++ lines to get to current state.
Reimplemented in CbcRounding, CbcSerendipity, CbcHeuristicFPump, CbcHeuristicGreedyCover, CbcHeuristicGreedyEquality, and CbcHeuristicLocal.
Definition at line 74 of file CbcHeuristic.hpp.
CbcHeuristic& CbcHeuristic::operator= | ( | const CbcHeuristic & | rhs | ) | [private] |
Illegal Assignment operator.
CbcModel* CbcHeuristic::model_ [protected] |
int CbcHeuristic::when_ [protected] |
When flag - 0 off, 1 at root, 2 other than root, 3 always.
Definition at line 81 of file CbcHeuristic.hpp.