Changeset 802 for stable/0.4


Ignore:
Timestamp:
Jan 30, 2012 6:11:34 PM (8 years ago)
Author:
pbelotti
Message:

fixing constant-objective glitches (merge from trunk)

Location:
stable/0.4/Couenne/src/bound_tightening
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable/0.4/Couenne/src/bound_tightening/boundTightening.cpp

    r738 r802  
    224224    objind   = Obj (0) -> Body () -> Index ();
    225225
    226   assert (objind >= 0);
     226  if (objind < 0)
     227    return 0;
    227228
    228229  CouNumber
  • stable/0.4/Couenne/src/bound_tightening/fake_tightening.cpp

    r795 r802  
    9696    objind   = Obj (0) -> Body  () -> Index ();
    9797
    98   assert (objind >= 0);
     98  //assert (objind >= 0);
    9999
    100100  bool
     
    114114  jnlst_ -> Printf (Ipopt::J_ERROR, J_BOUNDTIGHTENING,
    115115                    "  x_%d.  x = %10g, lb = %g, cutoff = %g-----------------\n",
    116                     index,xcur,Lb (objind),getCutOff());
     116                    index,xcur,objind >= 0 ? Lb (objind) : 0., getCutOff());
    117117
    118118  /*if (index == objind)
     
    175175    bool
    176176      feasible  = btCore (f_chg),                           // true if feasible with fake bound
    177       betterbds = Lb (objind) > getCutOff () + COUENNE_EPS; // true if over cutoff
     177      betterbds = objind >= 0 && (Lb (objind) > getCutOff () + COUENNE_EPS); // true if over cutoff
    178178
    179179    jnlst_ -> Printf (Ipopt::J_ERROR, J_BOUNDTIGHTENING,
    180180                      " [%10g,%10g] lb = %g {fea=%d,btr=%d} ",
    181                       Lb (index), Ub (index), Lb (objind),feasible,betterbds);
     181                      Lb (index), Ub (index), objind >= 0 ? Lb (objind) : 0., feasible,betterbds);
    182182
    183183    if (feasible && !betterbds) {
     
    329329                    "  [x%2d] pruned %s [%g, %g] -- lb = %g cutoff = %g\n",
    330330                    index,direction?"right":"left",
    331                     olb[index],oub[index], Lb (objind), getCutOff ());
     331                    olb[index],oub[index], objind >= 0 ? Lb (objind) : 0., getCutOff ());
    332332
    333333  return tightened ? 1 : 0;
Note: See TracChangeset for help on using the changeset viewer.