13 #include "CoinHelperFunctions.hpp"
30 #if defined(_MSC_VER) || defined(__MNO_CYGWIN)
33 #if 1 //ndef CBC_DUBIOUS_HEAP
105 virtual bool empty() ;
109 virtual int size()
const {
return static_cast<int>(
nodes_.size()); }
130 virtual void cleanTree(
CbcModel * model,
double cutoff,
double & bestPossibleObjective);
167 const double * currentLower,
168 const double * currentUpper);
173 # if CBC_DEBUG_HEAP > 0
177 void validateHeap() ;
201 #ifdef JJF_ZERO // not used
206 class CbcTreeArray :
public CbcTree {
214 CbcTreeArray (
const CbcTreeArray & rhs);
216 CbcTreeArray &
operator=(
const CbcTreeArray & rhs);
218 virtual ~CbcTreeArray();
242 virtual bool empty() ;
273 #include "CoinSearchTree.hpp"
280 class CbcNewTree :
public CbcTree,
public CoinSearchTreeManager {
288 CbcNewTree (
const CbcNewTree & rhs);
290 CbcNewTree &
operator=(
const CbcNewTree & rhs);
292 virtual ~CbcNewTree();
295 virtual CbcNewTree *
clone()
const;
321 virtual bool empty() ;
324 inline int size()
const {
325 return nodes_.size();
414 inline int size()
const {
428 virtual bool empty();
463 std::vector <CbcNode *>
nodes_;
virtual bool empty()
Test for an empty tree.
int * newBound_
New bound.
int getNumberBranching() const
Get number of branches.
CbcNode * bestAlternate()
Get best on list using alternate method.
virtual int size() const
Return size.
CbcTree()
Default Constructor.
virtual void push(CbcNode *x)
Add a node to the heap.
int maximumBranching_
Maximum size of variable list.
void fixTop()
After changing data in the top node, fix the heap.
void realpush(CbcNode *node)
unsigned int * branched_
Integer variables branched or bounded top bit set if new upper bound next bit set if a branch...
void setNumberBranching(int value)
Set number of branches.
void increaseSpace()
Increase space for data.
CbcTree & operator=(const CbcTree &rhs)
= operator
virtual void rebuild()
Rebuild the heap.
int maximumNodeNumber_
Maximum "node" number so far to split ties.
virtual CbcNode * bestNode(double cutoff)
Gets best node and takes off heap.
CbcNode * nodePointer(int i) const
Return a node pointer.
CbcNode * operator[](int i) const
Return a node pointer.
Using MS heap implementation.
virtual CbcTree * clone() const
Clone.
virtual void endSearch()
We may have got an intelligent tree so give it one more chance.
virtual void pop()
Remove the top node from the heap.
virtual CbcNode * top() const
Return the top node of the heap.
Information required while the node is live.
int getMaximumBranching() const
Get maximum branches.
virtual void cleanTree(CbcModel *model, double cutoff, double &bestPossibleObjective)
Prune the tree using an objective function cutoff.
void addBranchingInformation(const CbcModel *model, const CbcNodeInfo *nodeInfo, const double *currentLower, const double *currentUpper)
Adds branching information to complete state.
virtual void generateCpp(FILE *)
Create C++ lines to get to current state.
Information required to recreate the subproblem at this node.
std::vector< CbcNode * > nodes_
Storage vector for the heap.
void resetNodeNumbers()
Reset maximum node number.
int numberBranching_
Size of variable list.
CbcCompare comparison_
Sort predicate for heap ordering.
virtual ~CbcTree()
Destructor.
unsigned int * branched() const
Get branched variables.
void setComparison(CbcCompareBase &compare)
Set comparison function and resort heap.
int * newBounds() const
Get bounds.
int maximumNodeNumber() const
Get maximum node number.
virtual double getBestPossibleObjective()
Get best possible objective function in the tree.
Simple Branch and bound class.
void setMaximumBranching(int value)
Set maximum branches.