Changeset 987


Ignore:
Timestamp:
Jun 23, 2008 11:16:57 AM (11 years ago)
Author:
jpgoncal
Message:

fixed the bounds of GP and its descendants.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dynamicbranching/dynamicbranching.cpp

    r986 r987  
    11231123  const double P_value = parent.value_;
    11241124  int new_bd;
     1125#if 0
    11251126  if (down_child_stays_with_parent) {
    11261127    // Former up child of P is now the down child of GP, so we need to change
     
    11381139                           false /*lower bd*/, P_brvar, new_bd);
    11391140  }
     1141#else
     1142  if (down_child_stays_with_parent) {
     1143    // Former up child of P is now the down (or up) child of GP,
     1144    // so we need to change
     1145    // bounds of GP, its up (or down) child and descendants of that one.
     1146    new_bd = (int)std::ceil(P_value);
     1147    grandparent.lower_[P_brvar] = new_bd;
     1148    if(parent_is_down_child)
     1149      changeDescendantBounds(grandparent.child_up_,
     1150                             true /*lower bd*/, P_brvar, new_bd);
     1151    else
     1152      changeDescendantBounds(grandparent.child_down_,
     1153                             true /*lower bd*/, P_brvar, new_bd);
     1154  } else {
     1155    // Former down child of P is now the up (or down) child of GP,
     1156    // so we need to change
     1157    // bounds of GP, its down (or up) child and descendants of that one.
     1158    new_bd = (int)floor(P_value);
     1159    grandparent.upper_[P_brvar] = new_bd;
     1160    if(parent_is_down_child)
     1161      changeDescendantBounds(grandparent.child_up_,
     1162                             false /*lower bd*/, P_brvar, new_bd);
     1163    else
     1164      changeDescendantBounds(grandparent.child_down_,
     1165                             false /*lower bd*/, P_brvar, new_bd);
     1166  }
     1167#endif
    11401168#if defined(DEBUG_DYNAMIC_BRANCHING) && DEBUG_DYNAMIC_BRANCHING >= 1000
    11411169  if (childWasInfeasible) {
Note: See TracChangeset for help on using the changeset viewer.