#include <CbcHeuristicDive.hpp>
Inheritance diagram for CbcHeuristicDive:
Public Member Functions | |
CbcHeuristicDive () | |
CbcHeuristicDive (CbcModel &model) | |
CbcHeuristicDive (const CbcHeuristicDive &) | |
~CbcHeuristicDive () | |
virtual CbcHeuristicDive * | clone () const =0 |
Clone. | |
CbcHeuristicDive & | operator= (const CbcHeuristicDive &rhs) |
Assignment operator. | |
virtual void | generateCpp (FILE *fp) |
Create C++ lines to get to current state. | |
void | generateCpp (FILE *fp, const char *heuristic) |
Create C++ lines to get to current state - does work for base class. | |
virtual void | resetModel (CbcModel *model) |
Resets stuff if model changes. | |
virtual void | setModel (CbcModel *model) |
update model (This is needed if cliques update matrix etc) | |
virtual int | solution (double &objectiveValue, double *newSolution) |
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 (only if good) This is called after cuts have been added - so can not add cuts This does Fractional Diving | |
virtual void | validate () |
Validate model i.e. sets when_ to 0 if necessary (may be NULL). | |
void | selectBinaryVariables () |
Select candidate binary variables for fixing. | |
void | setPercentageToFix (double value) |
Set percentage of integer variables to fix at bounds. | |
void | setMaxIterations (int value) |
Set maximum number of iterations. | |
void | setMaxTime (double value) |
Set maximum time allowed. | |
virtual bool | canHeuristicRun () |
Tests if the heuristic can run. | |
virtual bool | selectVariableToBranch (OsiSolverInterface *solver, const double *newSolution, int &bestColumn, int &bestRound)=0 |
Returns true if all the fractional variables can be trivially rounded. | |
int | reducedCostFix (OsiSolverInterface *solver) |
Perform reduced cost fixing on integer variables. | |
Protected Attributes | |
CoinPackedMatrix | matrix_ |
CoinPackedMatrix | matrixByRow_ |
unsigned short * | downLocks_ |
unsigned short * | upLocks_ |
std::vector< int > | binVarIndex_ |
std::vector< int > | vbRowIndex_ |
double | percentageToFix_ |
int | maxIterations_ |
int | maxSimplexIterations_ |
double | maxTime_ |
Definition at line 11 of file CbcHeuristicDive.hpp.
CbcHeuristicDive::CbcHeuristicDive | ( | ) |
CbcHeuristicDive::CbcHeuristicDive | ( | CbcModel & | model | ) |
CbcHeuristicDive::CbcHeuristicDive | ( | const CbcHeuristicDive & | ) |
CbcHeuristicDive::~CbcHeuristicDive | ( | ) |
virtual CbcHeuristicDive* CbcHeuristicDive::clone | ( | ) | const [pure virtual] |
Clone.
Implements CbcHeuristic.
Implemented in CbcHeuristicDiveCoefficient, CbcHeuristicDiveFractional, CbcHeuristicDiveGuided, CbcHeuristicDiveLineSearch, CbcHeuristicDivePseudoCost, and CbcHeuristicDiveVectorLength.
CbcHeuristicDive& CbcHeuristicDive::operator= | ( | const CbcHeuristicDive & | rhs | ) |
Assignment operator.
virtual void CbcHeuristicDive::generateCpp | ( | FILE * | fp | ) | [inline, virtual] |
Create C++ lines to get to current state.
Reimplemented from CbcHeuristic.
Reimplemented in CbcHeuristicDiveCoefficient, CbcHeuristicDiveFractional, CbcHeuristicDiveGuided, CbcHeuristicDiveLineSearch, CbcHeuristicDivePseudoCost, and CbcHeuristicDiveVectorLength.
Definition at line 33 of file CbcHeuristicDive.hpp.
void CbcHeuristicDive::generateCpp | ( | FILE * | fp, | |
const char * | heuristic | |||
) |
Create C++ lines to get to current state - does work for base class.
Reimplemented from CbcHeuristic.
virtual void CbcHeuristicDive::resetModel | ( | CbcModel * | model | ) | [virtual] |
virtual void CbcHeuristicDive::setModel | ( | CbcModel * | model | ) | [virtual] |
virtual int CbcHeuristicDive::solution | ( | double & | objectiveValue, | |
double * | newSolution | |||
) | [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 (only if good) This is called after cuts have been added - so can not add cuts This does Fractional Diving
Implements CbcHeuristic.
virtual void CbcHeuristicDive::validate | ( | ) | [virtual] |
void CbcHeuristicDive::selectBinaryVariables | ( | ) |
Select candidate binary variables for fixing.
void CbcHeuristicDive::setPercentageToFix | ( | double | value | ) | [inline] |
Set percentage of integer variables to fix at bounds.
Definition at line 61 of file CbcHeuristicDive.hpp.
References percentageToFix_.
void CbcHeuristicDive::setMaxIterations | ( | int | value | ) | [inline] |
Set maximum number of iterations.
Definition at line 65 of file CbcHeuristicDive.hpp.
References maxIterations_.
void CbcHeuristicDive::setMaxTime | ( | double | value | ) | [inline] |
virtual bool CbcHeuristicDive::canHeuristicRun | ( | ) | [virtual] |
virtual bool CbcHeuristicDive::selectVariableToBranch | ( | OsiSolverInterface * | solver, | |
const double * | newSolution, | |||
int & | bestColumn, | |||
int & | bestRound | |||
) | [pure virtual] |
Returns true if all the fractional variables can be trivially rounded.
Returns false, if there is at least one fractional variable that is not trivially roundable. In this case, the bestColumn returned will not be trivially roundable.
Implemented in CbcHeuristicDiveCoefficient, CbcHeuristicDiveFractional, CbcHeuristicDiveGuided, CbcHeuristicDiveLineSearch, CbcHeuristicDivePseudoCost, and CbcHeuristicDiveVectorLength.
int CbcHeuristicDive::reducedCostFix | ( | OsiSolverInterface * | solver | ) |
Perform reduced cost fixing on integer variables.
CoinPackedMatrix CbcHeuristicDive::matrix_ [protected] |
Definition at line 93 of file CbcHeuristicDive.hpp.
CoinPackedMatrix CbcHeuristicDive::matrixByRow_ [protected] |
Definition at line 96 of file CbcHeuristicDive.hpp.
unsigned short* CbcHeuristicDive::downLocks_ [protected] |
Definition at line 99 of file CbcHeuristicDive.hpp.
unsigned short* CbcHeuristicDive::upLocks_ [protected] |
Definition at line 102 of file CbcHeuristicDive.hpp.
std::vector<int> CbcHeuristicDive::binVarIndex_ [protected] |
Definition at line 106 of file CbcHeuristicDive.hpp.
std::vector<int> CbcHeuristicDive::vbRowIndex_ [protected] |
Definition at line 109 of file CbcHeuristicDive.hpp.
double CbcHeuristicDive::percentageToFix_ [protected] |
int CbcHeuristicDive::maxIterations_ [protected] |
int CbcHeuristicDive::maxSimplexIterations_ [protected] |
Definition at line 118 of file CbcHeuristicDive.hpp.
double CbcHeuristicDive::maxTime_ [protected] |