Couenne 0.5.8
Public Member Functions | List of all members
Couenne::InitHeuristic Class Reference

A heuristic that stores the initial solution of the NLP. More...

#include <BonInitHeuristic.hpp>

+ Inheritance diagram for Couenne::InitHeuristic:
+ Collaboration diagram for Couenne::InitHeuristic:

Public Member Functions

 InitHeuristic (double objValue, const double *sol, CouenneProblem &cp)
 Constructor with model and Ipopt problems. More...
 
 InitHeuristic (const InitHeuristic &other)
 Copy constructor. More...
 
virtual ~InitHeuristic ()
 Destructor. More...
 
virtual CbcHeuristicclone () const
 Clone. More...
 
InitHeuristicoperator= (const InitHeuristic &rhs)
 Assignment operator. More...
 
virtual void resetModel (CbcModel *model)
 
virtual int solution (double &objectiveValue, double *newSolution)
 Run heuristic, return 1 if a better solution than the one passed is found and 0 otherwise. More...
 
- Public Member Functions inherited from CbcHeuristic
 CbcHeuristic ()
 
 CbcHeuristic (CbcModel &model)
 
 CbcHeuristic (const CbcHeuristic &)
 
virtual ~CbcHeuristic ()
 
virtual CbcHeuristicclone () const=0
 
CbcHeuristicoperator= (const CbcHeuristic &rhs)
 
virtual void setModel (CbcModel *model)
 
virtual void resetModel (CbcModel *model)=0
 
virtual int solution (double &objectiveValue, double *newSolution)=0
 
virtual int solution2 (double &, double *, OsiCuts &)
 
virtual void validate ()
 
void setWhen (int value)
 
int when () const
 
void setNumberNodes (int value)
 
int numberNodes () const
 
void setSwitches (int value)
 
int switches () const
 
bool exitNow (double bestObjective) const
 
void setFeasibilityPumpOptions (int value)
 
int feasibilityPumpOptions () const
 
void setModelOnly (CbcModel *model)
 
void setFractionSmall (double value)
 
double fractionSmall () const
 
int numberSolutionsFound () const
 
void incrementNumberSolutionsFound ()
 
int smallBranchAndBound (OsiSolverInterface *solver, int numberNodes, double *newSolution, double &newSolutionValue, double cutoff, std::string name) const
 
virtual void generateCpp (FILE *)
 
void generateCpp (FILE *fp, const char *heuristic)
 
virtual bool canDealWithOdd () const
 
const char * heuristicName () const
 
void setHeuristicName (const char *name)
 
void setSeed (int value)
 
int getSeed () const
 
void setDecayFactor (double value)
 
void setInputSolution (const double *solution, double objValue)
 
void setWhereFrom (int value)
 
int whereFrom () const
 
void setShallowDepth (int value)
 
void setHowOftenShallow (int value)
 
void setMinDistanceToRun (int value)
 
virtual bool shouldHeurRun (int whereFrom)
 
bool shouldHeurRun_randomChoice ()
 
void debugNodes ()
 
void printDistanceToNodes ()
 
int numRuns () const
 
int numCouldRun () const
 
bool isHeuristicInteger (const OsiSolverInterface *solver, int iColumn)
 
OsiSolverInterfacecloneBut (int type)
 

Additional Inherited Members

- Protected Attributes inherited from CbcHeuristic
CbcModelmodel_
 
int when_
 
int numberNodes_
 
int feasibilityPumpOptions_
 
double fractionSmall_
 
CoinThreadRandom randomNumberGenerator_
 
std::string heuristicName_
 
int howOften_
 
double decayFactor_
 
int switches_
 
int whereFrom_
 
int shallowDepth_
 
int howOftenShallow_
 
int numInvocationsInShallow_
 
int numInvocationsInDeep_
 
int lastRunDeep_
 
int numRuns_
 
int minDistanceToRun_
 
CbcHeuristicNodeList runNodes_
 
int numCouldRun_
 
int numberSolutionsFound_
 
int numberNodesDone_
 
double * inputSolution_
 

Detailed Description

A heuristic that stores the initial solution of the NLP.

This is computed before Cbc is started, and in this way we can tell Cbc about this.

Definition at line 24 of file BonInitHeuristic.hpp.

Constructor & Destructor Documentation

◆ InitHeuristic() [1/2]

Couenne::InitHeuristic::InitHeuristic ( double  objValue,
const double *  sol,
CouenneProblem cp 
)

Constructor with model and Ipopt problems.

◆ InitHeuristic() [2/2]

Couenne::InitHeuristic::InitHeuristic ( const InitHeuristic other)

Copy constructor.

◆ ~InitHeuristic()

virtual Couenne::InitHeuristic::~InitHeuristic ( )
virtual

Destructor.

Member Function Documentation

◆ clone()

virtual CbcHeuristic * Couenne::InitHeuristic::clone ( ) const
virtual

Clone.

Implements CbcHeuristic.

◆ operator=()

InitHeuristic & Couenne::InitHeuristic::operator= ( const InitHeuristic rhs)

Assignment operator.

◆ resetModel()

virtual void Couenne::InitHeuristic::resetModel ( CbcModel model)
inlinevirtual

Implements CbcHeuristic.

Definition at line 42 of file BonInitHeuristic.hpp.

◆ solution()

virtual int Couenne::InitHeuristic::solution ( double &  objectiveValue,
double *  newSolution 
)
virtual

Run heuristic, return 1 if a better solution than the one passed is found and 0 otherwise.

\argument objectiveValue Best known solution in input and value of solution found in output \argument newSolution Solution found by heuristic.

Todo:
Find a quicker way to get to Couenne objects, store them or something

Implements CbcHeuristic.


The documentation for this class was generated from the following file: