13#include "CoinHelperFunctions.hpp"
30#if defined(_MSC_VER) || defined(__MNO_CYGWIN)
108 virtual int size()
const {
return static_cast< int >(
nodes_.size()); }
181 const double *currentLower,
182 const double *currentUpper);
187#if CBC_DEBUG_HEAP > 0
226class CbcTreeArray : public CbcTree {
233 CbcTreeArray(
const CbcTreeArray &rhs);
235 CbcTreeArray &operator=(
const CbcTreeArray &rhs);
237 virtual ~CbcTreeArray();
240 virtual CbcTree *clone()
const;
242 virtual void generateCpp(FILE *) {}
254 virtual CbcNode *bestNode(
double cutoff);
261 virtual bool empty();
276 void cleanTree(
CbcModel *model,
double cutoff,
double &bestPossibleObjective);
278 virtual double getBestPossibleObjective();
291#include "CoinSearchTree.hpp"
298class CbcNewTree :
public CbcTree,
public CoinSearchTreeManager {
305 CbcNewTree(
const CbcNewTree &rhs);
307 CbcNewTree &operator=(
const CbcNewTree &rhs);
309 virtual ~CbcNewTree();
312 virtual CbcNewTree *clone()
const;
314 virtual void generateCpp(FILE *) {}
331 virtual CbcNode *bestNode(
double cutoff);
338 virtual bool empty();
341 inline int size()
const
343 return nodes_.size();
347 inline CbcNode *operator[](
int i)
const
353 inline CbcNode *nodePointer(
int i)
const
371 void cleanTree(
CbcModel *model,
double cutoff,
double &bestPossibleObjective);
377 virtual void endSearch() {}
431 inline int size()
const
448 virtual bool empty();
484 std::vector< CbcNode * >
nodes_;
Simple Branch and bound class.
Information required to recreate the subproblem at this node.
Information required while the node is live.
Using MS heap implementation.
int lastDepth_
Depth of last node pushed on tree.
CbcTree & operator=(const CbcTree &rhs)
= operator
int maximumBranching_
Maximum size of variable list.
CbcNode * bestAlternate()
Get best on list using alternate method.
virtual CbcTree * clone() const
Clone.
virtual CbcNode * bestNode(double cutoff)
Gets best node and takes off heap.
virtual ~CbcTree()
Destructor.
void setComparison(CbcCompareBase &compare)
Set comparison function and resort heap.
virtual void endSearch()
We may have got an intelligent tree so give it one more chance.
double lastObjective_
Objective of last node pushed on tree.
void increaseSpace()
Increase space for data.
void setNumberBranching(int value)
Set number of branches.
virtual double getBestPossibleObjective()
Get best possible objective function in the tree.
int numberBranching_
Size of variable list.
double lastObjective() const
Last objective in branch-and-cut search tree.
virtual CbcNode * top() const
Return the top node of the heap.
CbcNode * nodePointer(int i) const
Return a node pointer.
int maximumNodeNumber_
Maximum "node" number so far to split ties.
virtual void rebuild()
Rebuild the heap.
int lastUnsatisfied() const
Last number of objects unsatisfied.
void addBranchingInformation(const CbcModel *model, const CbcNodeInfo *nodeInfo, const double *currentLower, const double *currentUpper)
Adds branching information to complete state.
int * newBounds() const
Get bounds.
int maximumNodeNumber() const
Get maximum node number.
int lastUnsatisfied_
Number unsatisfied of last node pushed on tree.
virtual bool empty()
Test for an empty tree.
CbcTree(const CbcTree &rhs)
Copy constructor.
void fixTop()
After changing data in the top node, fix the heap.
virtual void push(CbcNode *x)
Add a node to the heap.
unsigned int * branched() const
Get branched variables.
virtual void cleanTree(CbcModel *model, double cutoff, double &bestPossibleObjective)
Prune the tree using an objective function cutoff.
CbcTree()
Default Constructor.
void resetNodeNumbers()
Reset maximum node number.
int getNumberBranching() const
Get number of branches.
CbcNode * operator[](int i) const
Return a node pointer.
virtual void pop()
Remove the top node from the heap.
void setMaximumBranching(int value)
Set maximum branches.
unsigned int * branched_
Integer variables branched or bounded top bit set if new upper bound next bit set if a branch.
void realpush(CbcNode *node)
virtual int size() const
Return size.
std::vector< CbcNode * > nodes_
Storage vector for the heap.
int getMaximumBranching() const
Get maximum branches.
int lastDepth() const
Last depth in branch-and-cut search tree.
int * newBound_
New bound.
CbcCompare comparison_
Sort predicate for heap ordering.
virtual void generateCpp(FILE *)
Create C++ lines to get to current state.