Changeset 367


Ignore:
Timestamp:
Jun 15, 2010 2:52:05 PM (10 years ago)
Author:
pbelotti
Message:

fixed erroneous infeasibility due to implied bound on exponential y=ex with very small upper bound on y

Location:
trunk/Couenne/src/expression/operators
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/expression/operators/exprExp.cpp

    r349 r367  
    5555  CouNumber b;
    5656
    57   if ((b = sign == expression::AUX_GEQ ? 0            : l [wind]) >= COUENNE_EPS) // lower bound   
    58     resL = updateBound (-1, l + ind, argument_->isInteger () ? ceil  (log (b)-COUENNE_EPS) : log (b));
     57  if ((b = sign == expression::AUX_GEQ ? 0.           : l [wind]) > 0.) // lower bound   
     58    resL = updateBound (-1, l + ind, argument_->isInteger () ? ceil  (log (b)) : log (b));
    5959
    60   if ((b = sign == expression::AUX_LEQ ? COIN_DBL_MAX : u [wind]) < COUENNE_INFINITY / 1e5) // upper bound
    61     resU = updateBound ( 1, u + ind, argument_->isInteger () ? floor (log (b)+COUENNE_EPS) : log (b));
     60  if ((b = sign == expression::AUX_LEQ ? COIN_DBL_MAX : u [wind]) < COIN_DBL_MAX / 10.) { // upper bound
    6261
    63   else if (b < - COUENNE_EPS) {
     62    if ((b >= -0.) && (b < COUENNE_EPS)) // to prevent infeasibilities due to numerics
     63      b = COUENNE_EPS;
     64
     65    resU = updateBound ( 1, u + ind, argument_ -> isInteger () ? floor (log (b)) : log (b));
     66  }
     67
     68  if (b < - COUENNE_EPS) {
    6469    // make it infeasible
    6570    resU = updateBound ( 1, u + ind, -1.) || true;
     
    6772  }
    6873
    69   if (resL) chg [ind].setLower(t_chg_bounds::CHANGED);
    70   if (resU) chg [ind].setUpper(t_chg_bounds::CHANGED);
     74  if (resL) chg [ind].setLower (t_chg_bounds::CHANGED);
     75  if (resU) chg [ind].setUpper (t_chg_bounds::CHANGED);
    7176
    7277  return (resL || resU);
  • trunk/Couenne/src/expression/operators/exprGroup.cpp

    r365 r367  
    129129    out << ' ';
    130130
    131     if      (coeff >   0.) out << '+' << coeff << "*";
    132     else if (coeff < - 0.) out        << coeff << "*";
    133     //else continue;
     131    if      (coeff >   0.) { out << '+'; if (coeff !=  1.) out << coeff << "*";}
     132    else if (coeff < - 0.) { out << '-'; if (coeff != -1.) out << coeff << "*";}
    134133
    135134    lcoeff_ [i]. first -> print (out, descend);
Note: See TracChangeset for help on using the changeset viewer.