Changeset 890 for branches


Ignore:
Timestamp:
Mar 6, 2008 1:47:15 PM (11 years ago)
Author:
jpgoncal
Message:

Small changes in CbcHeuristicNode?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/heur/Cbc/src/CbcHeuristic.cpp

    r886 r890  
    642642  CbcNodeInfo* nodeInfo = node->nodeInfo();
    643643  depth = 0;
    644   while (nodeInfo) {
     644  while (nodeInfo->owner() != NULL) {
    645645    const OsiBranchingObject* osibr =
    646646      nodeInfo->owner()->branchingObject();
     
    658658      int comp = brObj_[cnt]->compareBranchingObject(brObj_[i], &br);
    659659      switch (comp) {
    660       case 0: // disjoint decisions
     660      case CbcRangeSame: // the same range
     661      case CbcRangeDisjoint: // disjoint decisions
    661662        // should not happen! we are on a chain!
    662663        abort();
    663       case 1: // brObj_[cnt] is a subset of brObj_[i]
     664      case CbcRangeSubset: // brObj_[cnt] is a subset of brObj_[i]
    664665        delete brObj_[i];
    665666        break;
    666       case 2: // brObj_[i] is a subset of brObj_[cnt]
     667      case CbcRangeSuperset: // brObj_[i] is a subset of brObj_[cnt]
    667668        delete brObj_[cnt];
    668669        brObj_[cnt] = brObj_[i];
    669670        break;
    670       case 3: // overlap
     671      case CbcRangeOverlap: // overlap
    671672        delete brObj_[i];
    672673        delete brObj_[cnt];
     
    697698    const CbcBranchingObject* br1 = node->brObj_[j];
    698699    const int brComp = compare3BranchingObjects(br0, br1);
    699     switch (brComp) {
    700     case -1:
     700    if (brComp < 0) {
    701701      dist += subsetWeight;
    702702      ++i;
    703       break;
    704     case 1:
     703    }
     704    else if (brComp > 0) {
    705705      dist += subsetWeight;
    706706      ++j;
    707       break;
    708     case 0:
    709       {
    710         const int comp = br0->compareBranchingObject(br1, false);
    711         switch (comp) {
    712         case 0: // disjoint decisions
    713           dist += disjointWeight;
    714           break;
    715         case 1: // subset one way or another
    716         case 2:
    717           dist += subsetWeight;
    718           break;
    719         case 3: // overlap
    720           dist += overlapWeight;
    721           break;
    722         }
    723       }
    724       break;
     707    }
     708    else {
     709      const int comp = br0->compareBranchingObject(br1, false);
     710      switch (comp) {
     711      case CbcRangeSame:
     712        // do nothing
     713        break;
     714      case CbcRangeDisjoint: // disjoint decisions
     715        dist += disjointWeight;
     716        break;
     717      case CbcRangeSubset: // subset one way or another
     718      case CbcRangeSuperset:
     719        dist += subsetWeight;
     720        break;
     721      case CbcRangeOverlap: // overlap
     722        dist += overlapWeight;
     723        break;
     724      }
     725      ++i;
     726      ++j;
    725727    }
    726728  }
Note: See TracChangeset for help on using the changeset viewer.