Changeset 616 for branches


Ignore:
Timestamp:
Jun 4, 2007 4:53:44 AM (12 years ago)
Author:
forrest
Message:

exit a bit earlier on easy models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Cbc/src/CbcModel.cpp

    r607 r616  
    902902     int value=131072;
    903903     clpSolver->setSpecialOptions(clpSolver->specialOptions()|value);
    904      simplex->setSpecialOptions(simplex->specialOptions()|value);
     904     if ((clpSolver->specialOptions()&value)!=0)
     905       simplex->setSpecialOptions(simplex->specialOptions()|value);
    905906     //if (simplex->numberRows()<50)
    906907     //simplex->setAlphaAccuracy(1.0);
     
    10561057  }
    10571058  currentNumberCuts_ = numberNewCuts_ ;
     1059  // See if can stop on gap
     1060  stoppedOnGap_ = false ;
     1061  bestPossibleObjective_ = solver_->getObjValue()*solver_->getObjSense();
     1062  double testGap = CoinMax(dblParam_[CbcAllowableGap],
     1063                           CoinMax(fabs(bestObjective_),fabs(bestPossibleObjective_))
     1064                           *dblParam_[CbcAllowableFractionGap]);
     1065  if (bestObjective_-bestPossibleObjective_ < testGap && getCutoffIncrement()>=0.0) {
     1066    if (bestPossibleObjective_<getCutoff()) {
     1067      stoppedOnGap_ = true ;
     1068      messageHandler()->message(CBC_GAP,messages())
     1069        << bestObjective_-bestPossibleObjective_
     1070        << dblParam_[CbcAllowableGap]
     1071        << dblParam_[CbcAllowableFractionGap]*100.0
     1072        << CoinMessageEol ;
     1073      secondaryStatus_ = 2;
     1074    }
     1075    feasible = false;
     1076  }
    10581077/*
    10591078  We've taken the continuous relaxation as far as we can. Time to branch.
     
    12221241    for (i = 0;i < numberObjects_;i++)
    12231242      object_[i]->resetBounds(solver_) ; }
    1224   stoppedOnGap_ = false ;
    12251243/*
    12261244  Feasible? Then we should have either a live node prepped for future
     
    19571975      else
    19581976      {
    1959         tree_->cleanTree(this,-COIN_DBL_MAX,bestPossibleObjective_) ;
     1977        if (tree_->size())
     1978          tree_->cleanTree(this,-COIN_DBL_MAX,bestPossibleObjective_) ;
    19601979        delete nextRowCut_;
    19611980        // We need to get rid of node if is has already been popped from tree
Note: See TracChangeset for help on using the changeset viewer.