Ignore:
Timestamp:
Aug 21, 2009 12:19:13 PM (10 years ago)
Author:
forrest
Message:

fixes

File:
1 edited

Legend:

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

    r1211 r1212  
    350350  CoinWarmStartBasis bestBasis;
    351351  bool exitAll=false;
    352   double saveBestObjective = model_->getMinimizationObjValue();
     352  //double saveBestObjective = model_->getMinimizationObjValue();
    353353  int numberSolutions=0;
    354354  OsiSolverInterface * solver = NULL;
     
    595595      int newNumberInfeas=0;
    596596      returnCode=0;
    597       if (model_->getCurrentSeconds()>model_->getMaximumSeconds()) {
     597      if (model_->maximumSecondsReached()) {
    598598        exitAll=true;
    599599        break;
     
    609609      if (numberIterationsPass1>=0) {
    610610        int n = totalNumberIterations - numberIterationsLastPass;
    611         double perPass = totalNumberIterations/(totalNumberPasses+numberPasses);
     611        double perPass = totalNumberIterations/
     612          (totalNumberPasses+numberPasses+1.0e-5);
    612613        perPass /= (solver->getNumRows()+numberColumns);
    613614        double test = moreIterations ? 0.3 : 0.0;
     
    737738                  model_->setBestSolution(saveOldSolution,numberColumns,saveObjectiveValue);
    738739                delete [] saveOldSolution;
    739                 if (!action||model_->getCurrentSeconds()>model_->getMaximumSeconds()) {
     740                if (!action||model_->maximumSecondsReached()) {
    740741                  exitAll=true; // exit
    741742                  break;
     
    979980                    model_->setBestSolution(saveOldSolution,numberColumns,saveObjectiveValue);
    980981                  delete [] saveOldSolution;
    981                   if (!action||model_->getCurrentSeconds()>model_->getMaximumSeconds()) {
     982                  if (!action||model_->maximumSecondsReached()) {
    982983                    exitAll=true; // exit
    983984                    break;
     
    18651866#endif
    18661867  delete solver; // probably NULL but do anyway
    1867   if (!finalReturnCode&&closestSolution&&closestObjectiveValue <= 10.0&&usedColumn) {
     1868  if (!finalReturnCode&&closestSolution&&closestObjectiveValue <= 10.0&&
     1869      usedColumn&&!model_->maximumSecondsReached()) {
    18681870    // try a bit of branch and bound
    18691871    OsiSolverInterface * newSolver = cloneBut(1); // was model_->continuousSolver()->clone();
     
    19291931  if (bestBasis.getNumStructural())
    19301932    model_->setBestSolutionBasis(bestBasis);
    1931   model_->setMinimizationObjValue(saveBestObjective);
     1933  //model_->setMinimizationObjValue(saveBestObjective);
    19321934  if ((accumulate_&1)!=0&&numberSolutions>1&&!model_->getSolutionCount()) {
    19331935    model_->setSolutionCount(1); // for local search
Note: See TracChangeset for help on using the changeset viewer.