Changeset 877


Ignore:
Timestamp:
Aug 1, 2012 6:42:10 AM (7 years ago)
Author:
pbelotti
Message:

minor fix for efficiency in disj cuts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/disjunctive/generateDisjCuts.cpp

    r694 r877  
    259259    int ncols = si.getNumCols ();
    260260
    261     bool tightened = false;
    262 
    263261    for (int i=0; i<ncols; i++, newLo++, newUp++) {
    264262
    265       if (*newLo > *oldLo++ + COUENNE_EPS) {tighterLower.insert (i, *newLo); tightened = true;}
    266       if (*newUp < *oldUp++ - COUENNE_EPS) {tighterUpper.insert (i, *newUp); tightened = true;}
     263      if (*newLo > *oldLo++ + COUENNE_EPS) tighterLower.insert (i, *newLo);
     264      if (*newUp < *oldUp++ - COUENNE_EPS) tighterUpper.insert (i, *newUp);
    267265    }
    268266
    269     if (tightened) {
     267    if ((tighterLower.getNumElements () > 0) ||
     268        (tighterUpper.getNumElements () > 0)) {
    270269      OsiColCut tighter;
    271270      tighter.setLbs (tighterLower);
Note: See TracChangeset for help on using the changeset viewer.