Changeset 998 for branches


Ignore:
Timestamp:
Jul 1, 2008 6:55:57 PM (11 years ago)
Author:
jpgoncal
Message:

getTree was not working if there was a node deleted. Now it tests for node.previous_

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dynamicbranching/dynamicbranching.cpp

    r997 r998  
    994994    // NOTE: grandparent's obj val can;t be 1e100 since then parent would not
    995995    // exist...
    996     return false;
    997996    if (lpres.getObjValue > grandparent.objectiveValue_ + 1e-8) {
    998997      double djValue = lpres.getReducedCost[GP_brvar_fullid]*direction;
     
    13621361  for(int k=0; k<branchingTree.size_; k++) {
    13631362    DBNodeSimple& node = branchingTree.nodes_[k];
    1364     sprintf(line, "%d %d %d %d %f %d %d 0x%x %d %d\n",
    1365             k, node.node_id_, node.parent_, node.variable_,
    1366             node.value_, node.lower_[node.variable_],
    1367             node.upper_[node.variable_], node.way_,
    1368             node.child_down_, node.child_up_);
     1363    if(node.previous_ >= 0)
     1364      sprintf(line, "%d %d %d %d %f %d %d 0x%x %d %d %f\n",
     1365              k, node.node_id_, node.parent_, node.variable_,
     1366              node.value_, node.lower_[node.variable_],
     1367              node.upper_[node.variable_], node.way_,
     1368              node.child_down_, node.child_up_, node.objectiveValue_);
    13691369    tree += line;
    13701370  }
     
    15911591        const double parentGap = (cutoff-node.objectiveValue_)*direction + 1.0e-4;
    15921592        assert (parentGap >= 0);
    1593         const bool smallGap = false; // parentGap / fabs(cutoff) < 0.05;
     1593        const bool smallGap = parentGap / fabs(cutoff) < 0.05;
    15941594
    15951595        // We are not going to do any switching unless the gap is small
Note: See TracChangeset for help on using the changeset viewer.