Ignore:
Timestamp:
Nov 9, 2006 10:44:12 AM (13 years ago)
Author:
forrest
Message:

for C and minor change to compare

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Cbc/src/CbcCompareActual.cpp

    r484 r486  
    142142    saveWeight_(0.0),
    143143    numberSolutions_(0),
    144     treeSize_(0)
     144    treeSize_(0),
     145    breadthDepth_(5)
    145146{
    146147  test_=this;
     
    153154    saveWeight_(0.0),
    154155    numberSolutions_(0),
    155     treeSize_(0)
     156    treeSize_(0),
     157    breadthDepth_(5)
    156158{
    157159  test_=this;
     
    168170  numberSolutions_=rhs.numberSolutions_;
    169171  treeSize_ = rhs.treeSize_;
     172  breadthDepth_ = rhs.breadthDepth_;
    170173}
    171174
     
    187190    numberSolutions_=rhs.numberSolutions_;
    188191    treeSize_ = rhs.treeSize_;
     192    breadthDepth_ = rhs.breadthDepth_;
    189193  }
    190194  return *this;
     
    219223  }
    220224#else
    221   if ((weight_==-1.0&&(y->depth()>7||x->depth()>7))||weight_==-3.0) {
     225  if ((weight_==-1.0&&(y->depth()>breadthDepth_||x->depth()>breadthDepth_))||weight_==-3.0) {
    222226    int adjust =  (weight_==-3.0) ? 10000 : 0;
    223227    // before solution
     
    238242    }
    239243  } else {
    240     // always choose *smallest* depth if <= 7
     244    // always choose *greatest* depth if both <= breadthDepth_ otherwise <= breadthDepth_ if just one
    241245    int depthX = x->depth();
    242246    int depthY = y->depth();
    243     if (depthX<=7||depthY<=7) {
    244       if (depthX!=depthY) {
    245         return depthX < depthY;
     247    if (depthX<=breadthDepth_||depthY<=breadthDepth_) {
     248      if (depthX<=breadthDepth_&&depthY<=breadthDepth_) {
     249        if (depthX!=depthY) {
     250          return depthX < depthY;
     251        }
     252      } else {
     253        if (depthX!=depthY) {
     254          return depthX > depthY;
     255        }
    246256      }
    247257    }
Note: See TracChangeset for help on using the changeset viewer.