Changeset 1113 for stable


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

check allowable gap earlier

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/2.2/Cbc/src/CbcModel.cpp

    r1094 r1113  
    16301630  if ( intParam_[CbcMaxNumNode] < 0)
    16311631    eventHappened_=true; // stop as fast as possible
     1632  stoppedOnGap_ = false ;
     1633  // See if can stop on gap
     1634  bestPossibleObjective_ = solver_->getObjValue()*solver_->getObjSense();
     1635  double testGap = CoinMax(dblParam_[CbcAllowableGap],
     1636                           CoinMax(fabs(bestObjective_),fabs(bestPossibleObjective_))
     1637                           *dblParam_[CbcAllowableFractionGap]);
     1638  if (bestObjective_-bestPossibleObjective_ < testGap && getCutoffIncrement()>=0.0) {
     1639    if (bestPossibleObjective_<getCutoff())
     1640      stoppedOnGap_ = true ;
     1641    feasible = false;
     1642    eventHappened_=true; // stop as fast as possible
     1643  }
    16321644  statistics_ = NULL;
    16331645  // Do on switch
     
    16821694  currentNumberCuts_ = numberNewCuts_ ;
    16831695  // See if can stop on gap
    1684   stoppedOnGap_ = false ;
    16851696  bestPossibleObjective_ = solver_->getObjValue()*solver_->getObjSense();
    1686   double testGap = CoinMax(dblParam_[CbcAllowableGap],
     1697  testGap = CoinMax(dblParam_[CbcAllowableGap],
    16871698                           CoinMax(fabs(bestObjective_),fabs(bestPossibleObjective_))
    16881699                           *dblParam_[CbcAllowableFractionGap]);
Note: See TracChangeset for help on using the changeset viewer.