Go to the documentation of this file.
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()); }
179 const double * currentLower,
180 const double * currentUpper);
185 # if CBC_DEBUG_HEAP > 0
189 void validateHeap() ;
219 #ifdef JJF_ZERO // not used
224 class CbcTreeArray :
public CbcTree {
232 CbcTreeArray (
const CbcTreeArray & rhs);
234 CbcTreeArray &
operator=(
const CbcTreeArray & rhs);
236 virtual ~CbcTreeArray();
260 virtual bool empty() ;
291 #include "CoinSearchTree.hpp"
298 class CbcNewTree :
public CbcTree,
public CoinSearchTreeManager {
306 CbcNewTree (
const CbcNewTree & rhs);
308 CbcNewTree &
operator=(
const CbcNewTree & rhs);
310 virtual ~CbcNewTree();
313 virtual CbcNewTree *
clone()
const;
339 virtual bool empty() ;
342 inline int size()
const {
343 return nodes_.size();
432 inline int size()
const {
446 virtual bool empty();
481 std::vector <CbcNode *>
nodes_;
virtual CbcNode * bestNode(double cutoff)
Gets best node and takes off heap.
virtual double getBestPossibleObjective()
Get best possible objective function in the tree.
int maximumNodeNumber() const
Get maximum node number.
virtual ~CbcTree()
Destructor.
virtual void rebuild()
Rebuild the heap.
void setComparison(CbcCompareBase &compare)
Set comparison function and resort heap.
void addBranchingInformation(const CbcModel *model, const CbcNodeInfo *nodeInfo, const double *currentLower, const double *currentUpper)
Adds branching information to complete state.
virtual void pop()
Remove the top node from the heap.
int getNumberBranching() const
Get number of branches.
unsigned int * branched() const
Get branched variables.
int lastUnsatisfied() const
Last number of objects unsatisfied.
int * newBounds() const
Get bounds.
CbcNode * bestAlternate()
Get best on list using alternate method.
virtual void generateCpp(FILE *)
Create C++ lines to get to current state.
CbcTree()
Default Constructor.
double lastObjective_
Objective of last node pushed on tree.
int maximumBranching_
Maximum size of variable list.
std::vector< CbcNode * > nodes_
Storage vector for the heap.
int numberBranching_
Size of variable list.
void fixTop()
After changing data in the top node, fix the heap.
Simple Branch and bound class.
virtual int size() const
Return size.
Using MS heap implementation.
void setNumberBranching(int value)
Set number of branches.
void increaseSpace()
Increase space for data.
virtual void push(CbcNode *x)
Add a node to the heap.
Information required to recreate the subproblem at this node.
double lastObjective() const
Last objective in branch-and-cut search tree.
int maximumNodeNumber_
Maximum "node" number so far to split ties.
CbcTree & operator=(const CbcTree &rhs)
= operator
void setMaximumBranching(int value)
Set maximum branches.
virtual CbcNode * top() const
Return the top node of the heap.
void realpush(CbcNode *node)
CbcCompare comparison_
Sort predicate for heap ordering.
CbcNode * nodePointer(int i) const
Return a node pointer.
virtual bool empty()
Test for an empty tree.
Information required while the node is live.
unsigned int * branched_
Integer variables branched or bounded top bit set if new upper bound next bit set if a branch.
int getMaximumBranching() const
Get maximum branches.
virtual void cleanTree(CbcModel *model, double cutoff, double &bestPossibleObjective)
Prune the tree using an objective function cutoff.
virtual CbcTree * clone() const
Clone.
int lastUnsatisfied_
Number unsatisfied of last node pushed on tree.
CbcNode * operator[](int i) const
Return a node pointer.
virtual void endSearch()
We may have got an intelligent tree so give it one more chance.
int lastDepth_
Depth of last node pushed on tree.
CbcTree(const CbcTree &rhs)
Copy constructor.
void resetNodeNumbers()
Reset maximum node number.
int lastDepth() const
Last depth in branch-and-cut search tree.
int * newBound_
New bound.