2 #ifndef CoinSearchTree_H
3 #define CoinSearchTree_H
26 std::string
str()
const;
134 printf(
"prefs of sibligs: sibling[%i]: %s\n", i, pref.c_str());
147 static inline const char*
name() {
return "CoinSearchTreeComparePreferred"; }
157 }
else if (yPref < xPref) {
163 printf(
"Comparing xpref (%s) and ypref (%s) : %s\n",
164 xpref.str().c_str(), ypref.str().c_str(), retval ?
"T" :
"F");
173 static inline const char*
name() {
return "CoinSearchTreeCompareDepth"; }
192 static inline const char*
name() {
return "CoinSearchTreeCompareBreadth"; }
202 static inline const char*
name() {
return "CoinSearchTreeCompareBest"; }
227 virtual void fixTop() = 0;
231 virtual const char*
compName()
const = 0;
245 candidateList_.front()->currentNode()->getPreferred().print(output);
246 printf(
"top's pref: %s\n", output);
264 const bool incrInserted =
true) {
273 const bool incrInserted =
true) {
289 #ifdef CAN_TRUST_STL_HEAP
291 template <
class Comp>
319 const char*
compName()
const {
return Comp::name(); }
324 template <
class Comp>
345 for (ch = 2; ch <
size; pos = ch, ch *= 2) {
346 if (
comp_(candidates[ch+1], candidates[ch]))
348 if (
comp_(s, candidates[ch]))
350 candidates[pos] = candidates[ch];
353 if (
comp_(candidates[ch], s)) {
354 candidates[pos] = candidates[ch];
367 for (ch = pos/2; ch != 0; pos = ch, ch /= 2) {
368 if (
comp_(candidates[ch], s))
370 candidates[pos] = candidates[ch];
385 const char*
compName()
const {
return Comp::name(); }
443 const bool incrInserted =
true) {