Changeset 1257


Ignore:
Timestamp:
Aug 10, 2008 11:25:03 AM (12 years ago)
Author:
stefan
Message:

fix to get along with a possible rounding error resulting in an infinite loop (found by Arno Schoedl, see Clp mailing list from 09.08.08)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/BSP/Clp/src/ClpDualRowSteepest.cpp

    r1197 r1257  
    229229  tolerance = CoinMin(1000.0,tolerance);
    230230  tolerance *= tolerance; // as we are using squares
    231   double saveTolerance = tolerance;
    232231  double * solution = model_->solutionRegion();
    233232  double * lower = model_->lowerRegion();
     
    288287    printf("aac_p it %d\n",model_->numberIterations());
    289288#endif
     289  bool bToleranceIncreased = false;
    290290  if(model_->numberIterations()<model_->lastBadIteration()+200) {
    291291    // we can't really trust infeasibilities if there is dual error
    292     if (model_->largestDualError()>model_->largestPrimalError())
     292    if (model_->largestDualError()>model_->largestPrimalError()) {
    293293      tolerance *= CoinMin(model_->largestDualError()/model_->largestPrimalError(),1000.0);
     294      bToleranceIncreased = true;
     295    }
    294296  }
    295297  int numberWanted;
     
    383385  }
    384386  //printf("smallest %g largest %g\n",smallestWeight,largestWeight);
    385   if (chosenRow<0&& tolerance>saveTolerance) {
     387  if (chosenRow<0&& bToleranceIncreased) {
    386388    // won't line up with checkPrimalSolution - do again
    387389    double saveError = model_->largestDualError();
Note: See TracChangeset for help on using the changeset viewer.