Clp 1.17.6

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CoinSearchTree.hpp
Go to the documentation of this file.
1 /* $Id: CoinSearchTree.hpp 2083 2019-01-06 19:38:09Z unxusr $ */
2 // Copyright (C) 2006, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5
6 #ifndef CoinSearchTree_H
7 #define CoinSearchTree_H
8
9 #include <vector>
10 #include <algorithm>
11 #include <cmath>
12 #include <string>
13
14 #include "CoinFinite.hpp"
15 #include "CoinHelperFunctions.hpp"
16
17 // #define DEBUG_PRINT
18
19 //#############################################################################
20
21 class BitVector128 {
22 friend bool operator<(const BitVector128 &b0, const BitVector128 &b1);
23
24 private:
25 unsigned int bits_[4];
26
27 public:
28 BitVector128();
29 BitVector128(unsigned int bits[4]);
30 ~BitVector128() {}
31 void set(unsigned int bits[4]);
32 void setBit(int i);
33 void clearBit(int i);
34 std::string str() const;
35 };
36
37 bool operator<(const BitVector128 &b0, const BitVector128 &b1);
38
39 //#############################################################################
40
44 class CoinTreeNode {
45 protected:
46 CoinTreeNode()
47 : depth_(-1)
48 , fractionality_(-1)
49 , quality_(-COIN_DBL_MAX)
50 , true_lower_bound_(-COIN_DBL_MAX)
51 , preferred_()
52 {
53 }
54 CoinTreeNode(int d,
55 int f = -1,
56 double q = -COIN_DBL_MAX,
57 double tlb = -COIN_DBL_MAX,
58 BitVector128 p = BitVector128())
59 : depth_(d)
60 , fractionality_(f)
61 , quality_(q)
62 , true_lower_bound_(tlb)
63 , preferred_(p)
64 {
65 }
66 CoinTreeNode(const CoinTreeNode &x)
67 : depth_(x.depth_)
68 , fractionality_(x.fractionality_)
69 , quality_(x.quality_)
70 , true_lower_bound_(x.true_lower_bound_)
71 , preferred_(x.preferred_)
72 {
73 }
74 CoinTreeNode &operator=(const CoinTreeNode &x)
75 {
76 if (this != &x) {
77 depth_ = x.depth_;
78 fractionality_ = x.fractionality_;
79 quality_ = x.quality_;
80 true_lower_bound_ = x.true_lower_bound_;
81 preferred_ = x.preferred_;
82 }
83 return *this;
84 }
85
86 private:
88 int depth_;
91 int fractionality_;
95 double quality_;
99 double true_lower_bound_;
101 BitVector128 preferred_;
102
103 public:
104 virtual ~CoinTreeNode() {}
105
106 inline int getDepth() const { return depth_; }
107 inline int getFractionality() const { return fractionality_; }
108 inline double getQuality() const { return quality_; }
109 inline double getTrueLB() const { return true_lower_bound_; }
110 inline BitVector128 getPreferred() const { return preferred_; }
111
112 inline void setDepth(int d) { depth_ = d; }
113 inline void setFractionality(int f) { fractionality_ = f; }
114 inline void setQuality(double q) { quality_ = q; }
115 inline void setTrueLB(double tlb) { true_lower_bound_ = tlb; }
116 inline void setPreferred(BitVector128 p) { preferred_ = p; }
117 };
118
119 //==============================================================================
120
121 class CoinTreeSiblings {
122 private:
123 CoinTreeSiblings();
124 CoinTreeSiblings &operator=(const CoinTreeSiblings &);
125
126 private:
127 int current_;
128 int numSiblings_;
129 CoinTreeNode **siblings_;
130
131 public:
132 CoinTreeSiblings(const int n, CoinTreeNode **nodes)
133 : current_(0)
134 , numSiblings_(n)
135 , siblings_(new CoinTreeNode *[n])
136 {
137 CoinDisjointCopyN(nodes, n, siblings_);
138 }
139 CoinTreeSiblings(const CoinTreeSiblings &s)
140 : current_(s.current_)
141 , numSiblings_(s.numSiblings_)
142 , siblings_(new CoinTreeNode *[s.numSiblings_])
143 {
144 CoinDisjointCopyN(s.siblings_, s.numSiblings_, siblings_);
145 }
146 ~CoinTreeSiblings() { delete[] siblings_; }
147 inline CoinTreeNode *currentNode() const { return siblings_[current_]; }
149 inline bool advanceNode() { return ++current_ != numSiblings_; }
150 inline int toProcess() const { return numSiblings_ - current_; }
151 inline int size() const { return numSiblings_; }
152 inline void printPref() const
153 {
154 for (int i = 0; i < numSiblings_; ++i) {
155 std::string pref = siblings_[i]->getPreferred().str();
156 printf("prefs of sibligs: sibling[%i]: %s\n", i, pref.c_str());
157 }
158 }
159 };
160
161 //#############################################################################
162
168 struct CoinSearchTreeComparePreferred {
169 static inline const char *name() { return "CoinSearchTreeComparePreferred"; }
170 inline bool operator()(const CoinTreeSiblings *x,
171 const CoinTreeSiblings *y) const
172 {
173 const CoinTreeNode *xNode = x->currentNode();
174 const CoinTreeNode *yNode = y->currentNode();
175 const BitVector128 xPref = xNode->getPreferred();
176 const BitVector128 yPref = yNode->getPreferred();
177 bool retval = true;
178 if (xPref < yPref) {
179 retval = true;
180 } else if (yPref < xPref) {
181 retval = false;
182 } else {
183 retval = xNode->getQuality() < yNode->getQuality();
184 }
185 #ifdef DEBUG_PRINT
186 printf("Comparing xpref (%s) and ypref (%s) : %s\n",
187 xpref.str().c_str(), ypref.str().c_str(), retval ? "T" : "F");
188 #endif
189 return retval;
190 }
191 };
192
193 //-----------------------------------------------------------------------------
195 struct CoinSearchTreeCompareDepth {
196 static inline const char *name() { return "CoinSearchTreeCompareDepth"; }
197 inline bool operator()(const CoinTreeSiblings *x,
198 const CoinTreeSiblings *y) const
199 {
200 #if 1
201 return x->currentNode()->getDepth() >= y->currentNode()->getDepth();
202 #else
203 if (x->currentNode()->getDepth() > y->currentNode()->getDepth())
204 return 1;
205 if (x->currentNode()->getDepth() == y->currentNode()->getDepth() && x->currentNode()->getQuality() <= y->currentNode()->getQuality())
206 return 1;
207 return 0;
208 #endif
209 }
210 };
211
212 //-----------------------------------------------------------------------------
213 /* Breadth First Search */
214 struct CoinSearchTreeCompareBreadth {
215 static inline const char *name() { return "CoinSearchTreeCompareBreadth"; }
216 inline bool operator()(const CoinTreeSiblings *x,
217 const CoinTreeSiblings *y) const
218 {
219 return x->currentNode()->getDepth() < y->currentNode()->getDepth();
220 }
221 };
222
223 //-----------------------------------------------------------------------------
225 struct CoinSearchTreeCompareBest {
226 static inline const char *name() { return "CoinSearchTreeCompareBest"; }
227 inline bool operator()(const CoinTreeSiblings *x,
228 const CoinTreeSiblings *y) const
229 {
230 return x->currentNode()->getQuality() < y->currentNode()->getQuality();
231 }
232 };
233
234 //#############################################################################
235
236 class CoinSearchTreeBase {
237 private:
238 CoinSearchTreeBase(const CoinSearchTreeBase &);
239 CoinSearchTreeBase &operator=(const CoinSearchTreeBase &);
240
241 protected:
242 std::vector< CoinTreeSiblings * > candidateList_;
243 int numInserted_;
244 int size_;
245
246 protected:
247 CoinSearchTreeBase()
248 : candidateList_()
249 , numInserted_(0)
250 , size_(0)
251 {
252 }
253
254 virtual void realpop() = 0;
255 virtual void realpush(CoinTreeSiblings *s) = 0;
256 virtual void fixTop() = 0;
257
258 public:
259 virtual ~CoinSearchTreeBase() {}
260 virtual const char *compName() const = 0;
261
262 inline const std::vector< CoinTreeSiblings * > &getCandidates() const
263 {
264 return candidateList_;
265 }
266 inline bool empty() const { return candidateList_.empty(); }
267 inline int size() const { return size_; }
268 inline int numInserted() const { return numInserted_; }
269 inline CoinTreeNode *top() const
270 {
271 if (size_ == 0 || candidateList_.size() == 0)
272 return NULL;
273 #ifdef DEBUG_PRINT
274 char output[44];
275 output[43] = 0;
276 candidateList_.front()->currentNode()->getPreferred().print(output);
277 printf("top's pref: %s\n", output);
278 #endif
279 return candidateList_.front()->currentNode();
280 }
284 inline void pop()
285 {
286 CoinTreeSiblings *s = candidateList_.front();
287 if (!s->advanceNode()) {
288 realpop();
289 delete s;
290 } else {
291 fixTop();
292 }
293 --size_;
294 }
295 inline void push(int numNodes, CoinTreeNode **nodes,
296 const bool incrInserted = true)
297 {
298 CoinTreeSiblings *s = new CoinTreeSiblings(numNodes, nodes);
299 realpush(s);
300 if (incrInserted) {
301 numInserted_ += numNodes;
302 }
303 size_ += numNodes;
304 }
305 inline void push(const CoinTreeSiblings &sib,
306 const bool incrInserted = true)
307 {
308 CoinTreeSiblings *s = new CoinTreeSiblings(sib);
309 #ifdef DEBUG_PRINT
310 s->printPref();
311 #endif
312 realpush(s);
313 if (incrInserted) {
314 numInserted_ += sib.toProcess();
315 }
316 size_ += sib.toProcess();
317 }
318 };
319
320 //#############################################################################
321
322 // #define CAN_TRUST_STL_HEAP
323 #ifdef CAN_TRUST_STL_HEAP
324
325 template < class Comp >
326 class CoinSearchTree : public CoinSearchTreeBase {
327 private:
328 Comp comp_;
329
330 protected:
331 virtual void realpop()
332 {
333 candidateList_.pop_back();
334 }
335 virtual void fixTop()
336 {
337 CoinTreeSiblings *s = top();
338 realpop();
339 push(s, false);
340 }
341 virtual void realpush(CoinTreeSiblings *s)
342 {
343 nodes_.push_back(s);
344 std::push_heap(candidateList_.begin(), candidateList_.end(), comp_);
345 }
346
347 public:
348 CoinSearchTree()
349 : CoinSearchTreeBase()
350 , comp_()
351 {
352 }
353 CoinSearchTree(const CoinSearchTreeBase &t)
354 : CoinSearchTreeBase()
355 , comp_()
356 {
357 candidateList_ = t.getCandidates();
358 std::make_heap(candidateList_.begin(), candidateList_.end(), comp_);
359 numInserted_ = t.numInserted_;
360 size_ = t.size_;
361 }
362 ~CoinSearchTree() {}
363 const char *compName() const { return Comp::name(); }
364 };
365
366 #else
367
368 template < class Comp >
369 class CoinSearchTree : public CoinSearchTreeBase {
370 private:
371 Comp comp_;
372
373 protected:
374 virtual void realpop()
375 {
376 candidateList_[0] = candidateList_.back();
377 candidateList_.pop_back();
378 fixTop();
379 }
381 virtual void fixTop()
382 {
383 const size_t size = candidateList_.size();
384 if (size > 1) {
385 CoinTreeSiblings **candidates = &candidateList_[0];
386 CoinTreeSiblings *s = candidates[0];
387 --candidates;
388 size_t pos = 1;
389 size_t ch;
390 for (ch = 2; ch < size; pos = ch, ch *= 2) {
391 if (comp_(candidates[ch + 1], candidates[ch]))
392 ++ch;
393 if (comp_(s, candidates[ch]))
394 break;
395 candidates[pos] = candidates[ch];
396 }
397 if (ch == size) {
398 if (comp_(candidates[ch], s)) {
399 candidates[pos] = candidates[ch];
400 pos = ch;
401 }
402 }
403 candidates[pos] = s;
404 }
405 }
406 virtual void realpush(CoinTreeSiblings *s)
407 {
408 candidateList_.push_back(s);
409 CoinTreeSiblings **candidates = &candidateList_[0];
410 --candidates;
411 size_t pos = candidateList_.size();
412 size_t ch;
413 for (ch = pos / 2; ch != 0; pos = ch, ch /= 2) {
414 if (comp_(candidates[ch], s))
415 break;
416 candidates[pos] = candidates[ch];
417 }
418 candidates[pos] = s;
419 }
420
421 public:
422 CoinSearchTree()
423 : CoinSearchTreeBase()
424 , comp_()
425 {
426 }
427 CoinSearchTree(const CoinSearchTreeBase &t)
428 : CoinSearchTreeBase()
429 , comp_()
430 {
431 candidateList_ = t.getCandidates();
432 std::sort(candidateList_.begin(), candidateList_.end(), comp_);
433 numInserted_ = t.numInserted();
434 size_ = t.size();
435 }
436 virtual ~CoinSearchTree() {}
437 const char *compName() const { return Comp::name(); }
438 };
439
440 #endif
441
442 //#############################################################################
443
444 enum CoinNodeAction {
445 CoinAddNodeToCandidates,
446 CoinTestNodeForDiving,
447 CoinDiveIntoNode
448 };
449
450 class CoinSearchTreeManager {
451 private:
452 CoinSearchTreeManager(const CoinSearchTreeManager &);
453 CoinSearchTreeManager &operator=(const CoinSearchTreeManager &);
454
455 private:
456 CoinSearchTreeBase *candidates_;
457 int numSolution;
460 bool hasUB_;
461
463 bool recentlyReevaluatedSearchStrategy_;
464
465 public:
466 CoinSearchTreeManager()
467 : candidates_(NULL)
468 , numSolution(0)
469 , recentlyReevaluatedSearchStrategy_(true)
470 {
471 }
472 virtual ~CoinSearchTreeManager()
473 {
474 delete candidates_;
475 }
476
477 inline void setTree(CoinSearchTreeBase *t)
478 {
479 delete candidates_;
480 candidates_ = t;
481 }
482 inline CoinSearchTreeBase *getTree() const
483 {
484 return candidates_;
485 }
486
487 inline bool empty() const { return candidates_->empty(); }
488 inline size_t size() const { return candidates_->size(); }
489 inline size_t numInserted() const { return candidates_->numInserted(); }
490 inline CoinTreeNode *top() const { return candidates_->top(); }
491 inline void pop() { candidates_->pop(); }
492 inline void push(CoinTreeNode *node, const bool incrInserted = true)
493 {
494 candidates_->push(1, &node, incrInserted);
495 }
496 inline void push(const CoinTreeSiblings &s, const bool incrInserted = true)
497 {
498 candidates_->push(s, incrInserted);
499 }
500 inline void push(const int n, CoinTreeNode **nodes,
501 const bool incrInserted = true)
502 {
503 candidates_->push(n, nodes, incrInserted);
504 }
505
506 inline CoinTreeNode *bestQualityCandidate() const
507 {
508 return candidates_->top();
509 }
510 inline double bestQuality() const
511 {
512 return candidates_->top()->getQuality();
513 }
514 void newSolution(double solValue);
515 void reevaluateSearchStrategy();
516 };
517
518 //#############################################################################
519
520 #endif
521
522 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
523 */
CoinSearchTree::compName
const char * compName() const
Definition: CoinSearchTree.hpp:437
CoinHelperFunctions.hpp
CoinTreeSiblings::current_
int current_
Definition: CoinSearchTree.hpp:127
CoinSearchTreeManager::candidates_
CoinSearchTreeBase * candidates_
Definition: CoinSearchTree.hpp:456
CoinSearchTreeManager::recentlyReevaluatedSearchStrategy_
bool recentlyReevaluatedSearchStrategy_
variable used to test whether we need to reevaluate search strategy
Definition: CoinSearchTree.hpp:463
CoinSearchTreeBase::realpop
virtual void realpop()=0
CoinTreeSiblings::size
int size() const
Definition: CoinSearchTree.hpp:151
operator<
bool operator<(const BitVector128 &b0, const BitVector128 &b1)
CoinSearchTreeManager
Definition: CoinSearchTree.hpp:450
CoinSearchTreeManager::hasUB_
bool hasUB_
Whether there is an upper bound or not.
Definition: CoinSearchTree.hpp:460
CoinDisjointCopyN
void CoinDisjointCopyN(const T *from, const CoinBigIndex size, T *to)
This helper function copies an array to another location.
Definition: CoinHelperFunctions.hpp:138
CoinTreeNode::depth_
int depth_
The depth of the node in the tree.
Definition: CoinSearchTree.hpp:88
CoinSearchTreeCompareBest::operator()
bool operator()(const CoinTreeSiblings *x, const CoinTreeSiblings *y) const
Definition: CoinSearchTree.hpp:227
CoinTreeNode::preferred_
BitVector128 preferred_
Definition: CoinSearchTree.hpp:101
CoinTreeSiblings
Definition: CoinSearchTree.hpp:121
CoinTreeNode::CoinTreeNode
CoinTreeNode()
Definition: CoinSearchTree.hpp:46
BitVector128::set
void set(unsigned int bits[4])
CoinTreeSiblings::CoinTreeSiblings
CoinTreeSiblings(const int n, CoinTreeNode **nodes)
Definition: CoinSearchTree.hpp:132
CoinSearchTreeCompareBreadth
Definition: CoinSearchTree.hpp:214
BitVector128::bits_
unsigned int bits_[4]
Definition: CoinSearchTree.hpp:25
CoinSearchTree::realpop
virtual void realpop()
Definition: CoinSearchTree.hpp:374
BitVector128::BitVector128
BitVector128()
CoinTreeSiblings::~CoinTreeSiblings
~CoinTreeSiblings()
Definition: CoinSearchTree.hpp:146
CoinSearchTreeBase::numInserted
int numInserted() const
Definition: CoinSearchTree.hpp:268
CoinSearchTree::fixTop
virtual void fixTop()
After changing data in the top node, fix the heap.
Definition: CoinSearchTree.hpp:381
CoinSearchTreeManager::CoinSearchTreeManager
CoinSearchTreeManager()
Definition: CoinSearchTree.hpp:466
CoinSearchTreeBase::candidateList_
std::vector< CoinTreeSiblings * > candidateList_
Definition: CoinSearchTree.hpp:242
CoinSearchTreeManager::numSolution
int numSolution
Definition: CoinSearchTree.hpp:457
CoinSearchTreeManager::push
void push(CoinTreeNode *node, const bool incrInserted=true)
Definition: CoinSearchTree.hpp:492
BitVector128::setBit
void setBit(int i)
CoinNodeAction
CoinNodeAction
Definition: CoinSearchTree.hpp:444
CoinTreeNode::quality_
double quality_
Some quality for the node.
Definition: CoinSearchTree.hpp:95
CoinTreeNode::setQuality
void setQuality(double q)
Definition: CoinSearchTree.hpp:114
CoinSearchTreeManager::operator=
CoinSearchTreeManager & operator=(const CoinSearchTreeManager &)
CoinSearchTreeBase::top
CoinTreeNode * top() const
Definition: CoinSearchTree.hpp:269
CoinSearchTreeBase::numInserted_
int numInserted_
Definition: CoinSearchTree.hpp:243
CoinTreeNode::getTrueLB
double getTrueLB() const
Definition: CoinSearchTree.hpp:109
CoinSearchTree::CoinSearchTree
CoinSearchTree(const CoinSearchTreeBase &t)
Definition: CoinSearchTree.hpp:427
CoinSearchTreeComparePreferred
Function objects to compare search tree nodes.
Definition: CoinSearchTree.hpp:168
CoinSearchTreeBase::size_
int size_
Definition: CoinSearchTree.hpp:244
CoinTreeSiblings::advanceNode
bool advanceNode()
returns false if cannot be advanced
Definition: CoinSearchTree.hpp:149
CoinTreeSiblings::printPref
void printPref() const
Definition: CoinSearchTree.hpp:152
CoinTreeSiblings::currentNode
CoinTreeNode * currentNode() const
Definition: CoinSearchTree.hpp:147
CoinTreeNode::true_lower_bound_
double true_lower_bound_
A true lower bound on the node.
Definition: CoinSearchTree.hpp:99
CoinSearchTreeComparePreferred::name
static const char * name()
Definition: CoinSearchTree.hpp:169
CoinSearchTreeBase::push
void push(int numNodes, CoinTreeNode **nodes, const bool incrInserted=true)
Definition: CoinSearchTree.hpp:295
CoinSearchTreeBase::compName
virtual const char * compName() const =0
BitVector128::str
std::string str() const
CoinFinite.hpp
CoinTreeNode::getDepth
int getDepth() const
Definition: CoinSearchTree.hpp:106
CoinSearchTreeManager::~CoinSearchTreeManager
virtual ~CoinSearchTreeManager()
Definition: CoinSearchTree.hpp:472
CoinTreeNode::operator=
CoinTreeNode & operator=(const CoinTreeNode &x)
Definition: CoinSearchTree.hpp:74
CoinSearchTreeManager::pop
void pop()
Definition: CoinSearchTree.hpp:491
CoinSearchTreeBase::CoinSearchTreeBase
CoinSearchTreeBase()
Definition: CoinSearchTree.hpp:247
CoinSearchTreeManager::empty
bool empty() const
Definition: CoinSearchTree.hpp:487
BitVector128::operator<
friend bool operator<(const BitVector128 &b0, const BitVector128 &b1)
CoinSearchTreeCompareBreadth::name
static const char * name()
Definition: CoinSearchTree.hpp:215
CoinTreeNode::setDepth
void setDepth(int d)
Definition: CoinSearchTree.hpp:112
CoinSearchTreeManager::push
void push(const int n, CoinTreeNode **nodes, const bool incrInserted=true)
Definition: CoinSearchTree.hpp:500
CoinTreeNode::getFractionality
int getFractionality() const
Definition: CoinSearchTree.hpp:107
CoinDiveIntoNode
Definition: CoinSearchTree.hpp:447
CoinSearchTreeCompareBest
Best first search.
Definition: CoinSearchTree.hpp:225
CoinSearchTreeBase::empty
bool empty() const
Definition: CoinSearchTree.hpp:266
CoinSearchTreeManager::push
void push(const CoinTreeSiblings &s, const bool incrInserted=true)
Definition: CoinSearchTree.hpp:496
CoinSearchTreeManager::newSolution
void newSolution(double solValue)
CoinSearchTreeBase::operator=
CoinSearchTreeBase & operator=(const CoinSearchTreeBase &)
CoinTreeSiblings::siblings_
CoinTreeNode ** siblings_
Definition: CoinSearchTree.hpp:129
CoinTreeSiblings::CoinTreeSiblings
CoinTreeSiblings(const CoinTreeSiblings &s)
Definition: CoinSearchTree.hpp:139
CoinSearchTree
Definition: CoinSearchTree.hpp:369
CoinSearchTreeCompareDepth
Depth First Search.
Definition: CoinSearchTree.hpp:195
CoinSearchTreeCompareBest::name
static const char * name()
Definition: CoinSearchTree.hpp:226
CoinTreeNode::CoinTreeNode
CoinTreeNode(int d, int f=-1, double q=-COIN_DBL_MAX, double tlb=-COIN_DBL_MAX, BitVector128 p=BitVector128())
Definition: CoinSearchTree.hpp:54
CoinTreeNode::fractionality_
int fractionality_
A measure of fractionality, e.g., the number of unsatisfied integrality requirements.
Definition: CoinSearchTree.hpp:91
CoinSearchTree::~CoinSearchTree
virtual ~CoinSearchTree()
Definition: CoinSearchTree.hpp:436
CoinSearchTreeCompareBreadth::operator()
bool operator()(const CoinTreeSiblings *x, const CoinTreeSiblings *y) const
Definition: CoinSearchTree.hpp:216
CoinSearchTreeManager::getTree
CoinSearchTreeBase * getTree() const
Definition: CoinSearchTree.hpp:482
CoinSearchTreeCompareDepth::name
static const char * name()
Definition: CoinSearchTree.hpp:196
CoinSearchTreeBase::push
void push(const CoinTreeSiblings &sib, const bool incrInserted=true)
Definition: CoinSearchTree.hpp:305
CoinTreeSiblings::toProcess
int toProcess() const
Definition: CoinSearchTree.hpp:150
CoinTreeSiblings::operator=
CoinTreeSiblings & operator=(const CoinTreeSiblings &)
CoinSearchTreeBase::size
int size() const
Definition: CoinSearchTree.hpp:267
CoinSearchTreeManager::setTree
void setTree(CoinSearchTreeBase *t)
Definition: CoinSearchTree.hpp:477
CoinTreeNode::CoinTreeNode
CoinTreeNode(const CoinTreeNode &x)
Definition: CoinSearchTree.hpp:66
CoinTreeSiblings::CoinTreeSiblings
CoinTreeSiblings()
CoinTreeNode
A class from which the real tree nodes should be derived from.
Definition: CoinSearchTree.hpp:44
CoinSearchTreeManager::reevaluateSearchStrategy
void reevaluateSearchStrategy()
CoinSearchTree::realpush
virtual void realpush(CoinTreeSiblings *s)
Definition: CoinSearchTree.hpp:406
CoinTreeNode::setPreferred
void setPreferred(BitVector128 p)
Definition: CoinSearchTree.hpp:116
CoinSearchTree::CoinSearchTree
CoinSearchTree()
Definition: CoinSearchTree.hpp:422
CoinTreeSiblings::numSiblings_
int numSiblings_
Definition: CoinSearchTree.hpp:128
CoinSearchTreeManager::size
size_t size() const
Definition: CoinSearchTree.hpp:488
BitVector128::clearBit
void clearBit(int i)
CoinSearchTreeBase::fixTop
virtual void fixTop()=0
CoinTreeNode::setFractionality
void setFractionality(int f)
Definition: CoinSearchTree.hpp:113
CoinSearchTreeBase::pop
void pop()
pop will advance the next pointer among the siblings on the top and then moves the top to its correct...
Definition: CoinSearchTree.hpp:284
CoinTreeNode::getPreferred
BitVector128 getPreferred() const
Definition: CoinSearchTree.hpp:110
CoinSearchTreeManager::bestQuality
double bestQuality() const
Definition: CoinSearchTree.hpp:510
CoinAddNodeToCandidates
Definition: CoinSearchTree.hpp:445
CoinSearchTree::comp_
Comp comp_
Definition: CoinSearchTree.hpp:371
CoinSearchTreeBase::getCandidates
const std::vector< CoinTreeSiblings * > & getCandidates() const
Definition: CoinSearchTree.hpp:262
CoinSearchTreeCompareDepth::operator()
bool operator()(const CoinTreeSiblings *x, const CoinTreeSiblings *y) const
Definition: CoinSearchTree.hpp:197
COIN_DBL_MAX
const double COIN_DBL_MAX
Definition: CoinFinite.hpp:18
CoinSearchTreeManager::bestQualityCandidate
CoinTreeNode * bestQualityCandidate() const
Definition: CoinSearchTree.hpp:506
CoinTreeNode::getQuality
double getQuality() const
Definition: CoinSearchTree.hpp:108
CoinTestNodeForDiving
Definition: CoinSearchTree.hpp:446
CoinTreeNode::~CoinTreeNode
virtual ~CoinTreeNode()
Definition: CoinSearchTree.hpp:104
CoinSearchTreeManager::top
CoinTreeNode * top() const
Definition: CoinSearchTree.hpp:490
CoinTreeNode::setTrueLB
void setTrueLB(double tlb)
Definition: CoinSearchTree.hpp:115
BitVector128::~BitVector128
~BitVector128()
Definition: CoinSearchTree.hpp:30
CoinSearchTreeManager::numInserted
size_t numInserted() const
Definition: CoinSearchTree.hpp:489
CoinSearchTreeBase::realpush
virtual void realpush(CoinTreeSiblings *s)=0
CoinSearchTreeBase::~CoinSearchTreeBase
virtual ~CoinSearchTreeBase()
Definition: CoinSearchTree.hpp:259
BitVector128
Definition: CoinSearchTree.hpp:21
CoinSearchTreeComparePreferred::operator()
bool operator()(const CoinTreeSiblings *x, const CoinTreeSiblings *y) const
Definition: CoinSearchTree.hpp:170
CoinSearchTreeBase
Definition: CoinSearchTree.hpp:236