Changeset 477 for branches/devel/Cbc/src/CbcTree.hpp
- Timestamp:
- Nov 3, 2006 3:48:00 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/devel/Cbc/src/CbcTree.hpp
r441 r477 96 96 97 97 }; 98 99 /// New style 100 #include "CoinSearchTree.hpp" 101 /*! \class tree 102 \brief Implementation of live set as a heap. 103 104 This class is used to hold the set of live nodes in the search tree. 105 */ 106 107 class CbcNewTree : public CbcTree, public CoinSearchTreeManager { 108 109 public: 110 111 // Default Constructor 112 CbcNewTree (); 113 114 // Copy constructor 115 CbcNewTree ( const CbcNewTree & rhs); 116 // = operator 117 CbcNewTree & operator=(const CbcNewTree & rhs); 118 119 virtual ~CbcNewTree(); 120 121 /// Clone 122 virtual CbcNewTree * clone() const; 123 /// Create C++ lines to get to current state 124 virtual void generateCpp( FILE * fp) {}; 125 126 /*! \name Heap access and maintenance methods */ 127 //@{ 128 129 /// Set comparison function and resort heap 130 void setComparison(CbcCompareBase &compare); 131 132 /// Return the top node of the heap 133 virtual CbcNode * top() const; 134 135 /// Add a node to the heap 136 virtual void push(CbcNode * x); 137 138 /// Remove the top node from the heap 139 virtual void pop() ; 140 /// Gets best node and takes off heap 141 virtual CbcNode * bestNode(double cutoff); 142 143 //@} 144 /*! \name vector methods */ 145 //@{ 146 147 /// Test if empty *** note may be overridden 148 virtual bool empty() ; 149 150 /// Return size 151 inline int size() const 152 { return nodes_.size();} 153 154 /// [] operator 155 inline CbcNode * operator [] (int i) const 156 { return nodes_[i];} 157 158 /// Return a node pointer 159 inline CbcNode * nodePointer (int i) const 160 { return nodes_[i];} 161 162 //@} 163 164 /*! \name Search tree maintenance */ 165 //@{ 166 167 /*! \brief Prune the tree using an objective function cutoff 168 169 This routine removes all nodes with objective worst than the 170 specified cutoff value. 171 It also sets bestPossibleObjective to best 172 of all on tree before deleting. 173 */ 174 175 void cleanTree(CbcModel * model, double cutoff, double & bestPossibleObjective); 176 177 /// Get best on list using alternate method 178 CbcNode * bestAlternate(); 179 180 /// We may have got an intelligent tree so give it one more chance 181 virtual void endSearch() {} 182 //@} 183 protected: 184 185 186 }; 98 187 #endif 99 188
Note: See TracChangeset
for help on using the changeset viewer.