Changeset 835 for stable/0.4


Ignore:
Timestamp:
Feb 11, 2012 2:27:53 PM (8 years ago)
Author:
pbelotti
Message:

real fix for power implied bound bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/0.4/Couenne/src/bound_tightening/operators/impliedBounds-exprPow.cpp

    r834 r835  
    5353
    5454  CouNumber
    55     wl = ((sign == expression::AUX_LEQ) ? -COIN_DBL_MAX : l [wind]), // lower w
    56     wu = ((sign == expression::AUX_GEQ) ?  COIN_DBL_MAX : u [wind]); // upper w
     55    wl = ((sign == expression::AUX_GEQ) ? -COIN_DBL_MAX : l [wind]), // lower w
     56    wu = ((sign == expression::AUX_LEQ) ?  COIN_DBL_MAX : u [wind]); // upper w
    5757
    5858  if ((isint || isinvint) && (intk % 2)) {
     
    9292      bound = (k>0) ? wl : wu;
    9393
    94       CouNumber xl = l [index],
    95                 xu = u [index],
    96                 xb = safe_pow (bound, 1./k);
     94      if (bound > 0.) {
    9795
    98       if      (xl > - xb + COUENNE_EPS) resL = updateBound (-1, l + index,   xb) || resL;
    99       else if (xu <   xb - COUENNE_EPS) resU = updateBound ( 1, u + index, - xb) || resU;
     96        CouNumber
     97          xl = l [index],
     98          xu = u [index],
     99          xb = safe_pow (bound, 1./k);
     100
     101        if      (xl > - xb + COUENNE_EPS) resL = updateBound (-1, l + index,   xb) || resL;
     102        else if (xu <   xb - COUENNE_EPS) resU = updateBound ( 1, u + index, - xb) || resU;
     103      }
    100104
    101105    } else {
Note: See TracChangeset for help on using the changeset viewer.