Changeset 1114


Ignore:
Timestamp:
Jan 8, 2009 6:28:02 AM (10 years ago)
Author:
forrest
Message:

check allowable gap earlier

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcModel.cpp

    r1112 r1114  
    17901790  if ( intParam_[CbcMaxNumNode] < 0)
    17911791    eventHappened_=true; // stop as fast as possible
     1792  stoppedOnGap_ = false ;
     1793  // See if can stop on gap
     1794  bestPossibleObjective_ = solver_->getObjValue()*solver_->getObjSense();
     1795  double testGap = CoinMax(dblParam_[CbcAllowableGap],
     1796                           CoinMax(fabs(bestObjective_),fabs(bestPossibleObjective_))
     1797                           *dblParam_[CbcAllowableFractionGap]);
     1798  if (bestObjective_-bestPossibleObjective_ < testGap && getCutoffIncrement()>=0.0) {
     1799    if (bestPossibleObjective_<getCutoff())
     1800      stoppedOnGap_ = true ;
     1801    feasible = false;
     1802    eventHappened_=true; // stop as fast as possible
     1803  }
    17921804  statistics_ = NULL;
    17931805  // Do on switch
     
    18421854  currentNumberCuts_ = numberNewCuts_ ;
    18431855  // See if can stop on gap
    1844   stoppedOnGap_ = false ;
    18451856  bestPossibleObjective_ = solver_->getObjValue()*solver_->getObjSense();
    1846   double testGap = CoinMax(dblParam_[CbcAllowableGap],
     1857  testGap = CoinMax(dblParam_[CbcAllowableGap],
    18471858                           CoinMax(fabs(bestObjective_),fabs(bestPossibleObjective_))
    18481859                           *dblParam_[CbcAllowableFractionGap]);
Note: See TracChangeset for help on using the changeset viewer.