#include <CbcTree.hpp>
Inheritance diagram for CbcTree:
Public Member Functions | |
Constructors and related | |
CbcTree () | |
Default Constructor. | |
CbcTree (const CbcTree &rhs) | |
Copy constructor. | |
CbcTree & | operator= (const CbcTree &rhs) |
= operator | |
virtual | ~CbcTree () |
Destructor. | |
virtual CbcTree * | clone () const |
Clone. | |
virtual void | generateCpp (FILE *) |
Create C++ lines to get to current state. | |
Heap access and maintenance methods | |
void | setComparison (CbcCompareBase &compare) |
Set comparison function and resort heap. | |
virtual CbcNode * | top () const |
Return the top node of the heap. | |
virtual void | push (CbcNode *x) |
Add a node to the heap. | |
virtual void | pop () |
Remove the top node from the heap. | |
virtual CbcNode * | bestNode (double cutoff) |
Gets best node and takes off heap. | |
virtual void | rebuild () |
Rebuild the heap. | |
Direct node access methods | |
virtual bool | empty () |
Test for an empty tree. | |
virtual int | size () const |
Return size. | |
CbcNode * | operator[] (int i) const |
Return a node pointer. | |
CbcNode * | nodePointer (int i) const |
Return a node pointer. | |
Search tree maintenance | |
virtual void | cleanTree (CbcModel *model, double cutoff, double &bestPossibleObjective) |
Prune the tree using an objective function cutoff. | |
CbcNode * | bestAlternate () |
Get best on list using alternate method. | |
virtual void | endSearch () |
We may have got an intelligent tree so give it one more chance. | |
virtual double | getBestPossibleObjective () |
Get best possible objective function in the tree. | |
void | resetNodeNumbers () |
Reset maximum node number. | |
int | maximumNodeNumber () const |
Get maximum node number. | |
void | setNumberBranching (int value) |
Set number of branches. | |
int | getNumberBranching () const |
Get number of branches. | |
void | setMaximumBranching (int value) |
Set maximum branches. | |
int | getMaximumBranching () const |
Get maximum branches. | |
unsigned int * | branched () const |
Get branched variables. | |
int * | newBounds () const |
Get bounds. | |
void | addBranchingInformation (const CbcModel *model, const CbcNodeInfo *nodeInfo, const double *currentLower, const double *currentUpper) |
Adds branching information to complete state. | |
void | increaseSpace () |
Increase space for data. | |
Protected Attributes | |
std::vector< CbcNode * > | nodes_ |
Storage vector for the heap. | |
CbcCompare | comparison_ |
Sort predicate for heap ordering. | |
int | maximumNodeNumber_ |
Maximum "node" number so far to split ties. | |
int | numberBranching_ |
Size of variable list. | |
int | maximumBranching_ |
Maximum size of variable list. | |
unsigned int * | branched_ |
Integer variables branched or bounded top bit set if new upper bound next bit set if a branch. | |
int * | newBound_ |
New bound. |
This class is used to hold the set of live nodes in the search tree.
Definition at line 53 of file CbcTree.hpp.
CbcTree::CbcTree | ( | ) |
Default Constructor.
CbcTree::CbcTree | ( | const CbcTree & | rhs | ) |
Copy constructor.
virtual CbcTree::~CbcTree | ( | ) | [virtual] |
Destructor.
virtual CbcTree* CbcTree::clone | ( | ) | const [virtual] |
virtual void CbcTree::generateCpp | ( | FILE * | ) | [inline, virtual] |
Create C++ lines to get to current state.
Reimplemented in CbcTreeLocal, and CbcTreeVariable.
Definition at line 74 of file CbcTree.hpp.
void CbcTree::setComparison | ( | CbcCompareBase & | compare | ) |
Set comparison function and resort heap.
virtual CbcNode* CbcTree::top | ( | ) | const [virtual] |
virtual void CbcTree::push | ( | CbcNode * | x | ) | [virtual] |
virtual void CbcTree::pop | ( | ) | [virtual] |
virtual CbcNode* CbcTree::bestNode | ( | double | cutoff | ) | [virtual] |
Gets best node and takes off heap.
Before returning the node from the top of the heap, the node is offered an opportunity to reevaluate itself. Callers should be prepared to check that the node returned is suitable for use.
virtual void CbcTree::rebuild | ( | ) | [virtual] |
Rebuild the heap.
virtual bool CbcTree::empty | ( | ) | [virtual] |
virtual int CbcTree::size | ( | ) | const [inline, virtual] |
CbcNode* CbcTree::operator[] | ( | int | i | ) | const [inline] |
CbcNode* CbcTree::nodePointer | ( | int | i | ) | const [inline] |
virtual void CbcTree::cleanTree | ( | CbcModel * | model, | |
double | cutoff, | |||
double & | bestPossibleObjective | |||
) | [virtual] |
Prune the tree using an objective function cutoff.
This routine removes all nodes with objective worse than the specified cutoff value. It also sets bestPossibleObjective to the best objective over remaining nodes.
CbcNode* CbcTree::bestAlternate | ( | ) |
Get best on list using alternate method.
virtual void CbcTree::endSearch | ( | ) | [inline, virtual] |
We may have got an intelligent tree so give it one more chance.
Reimplemented in CbcTreeLocal, and CbcTreeVariable.
Definition at line 132 of file CbcTree.hpp.
virtual double CbcTree::getBestPossibleObjective | ( | ) | [virtual] |
Get best possible objective function in the tree.
void CbcTree::resetNodeNumbers | ( | ) | [inline] |
int CbcTree::maximumNodeNumber | ( | ) | const [inline] |
void CbcTree::setNumberBranching | ( | int | value | ) | [inline] |
int CbcTree::getNumberBranching | ( | ) | const [inline] |
void CbcTree::setMaximumBranching | ( | int | value | ) | [inline] |
int CbcTree::getMaximumBranching | ( | ) | const [inline] |
unsigned int* CbcTree::branched | ( | ) | const [inline] |
int* CbcTree::newBounds | ( | ) | const [inline] |
void CbcTree::addBranchingInformation | ( | const CbcModel * | model, | |
const CbcNodeInfo * | nodeInfo, | |||
const double * | currentLower, | |||
const double * | currentUpper | |||
) |
Adds branching information to complete state.
void CbcTree::increaseSpace | ( | ) |
Increase space for data.
std::vector<CbcNode *> CbcTree::nodes_ [protected] |
CbcCompare CbcTree::comparison_ [protected] |
int CbcTree::maximumNodeNumber_ [protected] |
int CbcTree::numberBranching_ [protected] |
int CbcTree::maximumBranching_ [protected] |
unsigned int* CbcTree::branched_ [protected] |
Integer variables branched or bounded top bit set if new upper bound next bit set if a branch.
Definition at line 192 of file CbcTree.hpp.
int* CbcTree::newBound_ [protected] |