Ignore:
Timestamp:
Feb 10, 2015 7:12:46 AM (5 years ago)
Author:
forrest
Message:

was not totally threadsafe!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/1.16/Clp/src/ClpSimplex.cpp

    r2082 r2114  
    534534          largeValue_ = value;
    535535}
    536 double minimumPrimalToleranceZZ=0.0;
    537 #define CLP_INFEAS_SAVE 5
    538 double averageInfeasZZ[CLP_INFEAS_SAVE];
    539536int
    540537ClpSimplex::gutsOfSolution ( double * givenDuals,
     
    825822         bool doneFiddling=false;
    826823         // Optimization may make exact test iffy
    827          double testTolerance=minimumPrimalToleranceZZ+1.0e-15;
     824         double testTolerance=minimumPrimalTolerance_+1.0e-15;
    828825         while (!doneFiddling) {
    829826           doneFiddling=true;
     
    833830             double saveTolerance=primalTolerance_;
    834831             primalTolerance_=CoinMax(0.25*primalTolerance_,
    835                                       minimumPrimalToleranceZZ);
     832                                      minimumPrimalTolerance_);
    836833             printf("Resetting primal tolerance from %g to %g\n",
    837834                    saveTolerance,primalTolerance_);
     
    849846             double minimum=COIN_DBL_MAX;
    850847             double averageTotal=average;
    851              bool firstTime=averageInfeasZZ[0]==COIN_DBL_MAX;
     848             bool firstTime=averageInfeasibility_[0]==COIN_DBL_MAX;
    852849             for (int i=0;i<CLP_INFEAS_SAVE-1;i++) {
    853                double value = averageInfeasZZ[i+1];
     850               double value = averageInfeasibility_[i+1];
    854851               averageTotal+=value;
    855                averageInfeasZZ[i]=value;
     852               averageInfeasibility_[i]=value;
    856853               minimum=CoinMin(minimum,value);
    857854             }
    858              averageInfeasZZ[CLP_INFEAS_SAVE-1]=average;
     855             averageInfeasibility_[CLP_INFEAS_SAVE-1]=average;
    859856             averageTotal /= CLP_INFEAS_SAVE;
    860857             double oldTolerance=primalTolerance_;
    861              if (averageInfeasZZ[0]!=COIN_DBL_MAX) {
     858             if (averageInfeasibility_[0]!=COIN_DBL_MAX) {
    862859               if (firstTime) {
    863860                 primalTolerance_=CoinMin(0.1,0.1*averageTotal);
     
    867864               }
    868865               primalTolerance_=
    869                  CoinMax(primalTolerance_,minimumPrimalToleranceZZ);
     866                 CoinMax(primalTolerance_,minimumPrimalTolerance_);
    870867             }
    871868             if (primalTolerance_!=oldTolerance) {
     
    55425539#endif
    55435540     for (int i=0;i<CLP_INFEAS_SAVE;i++)
    5544        averageInfeasZZ[i]=COIN_DBL_MAX;
     5541       averageInfeasibility_[i]=COIN_DBL_MAX;
    55455542#ifdef EXPENSIVE
    55465543     static int dualCount = 0;
Note: See TracChangeset for help on using the changeset viewer.