Changeset 2115


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

make more threadsafe

Location:
trunk/Clp/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src

  • trunk/Clp/src/ClpSimplex.cpp

    r2082 r2115  
    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;
  • trunk/Clp/src/ClpSimplex.hpp

    r2086 r2115  
    15581558     /// Acceptable pivot value just after factorization
    15591559     double acceptablePivot_;
     1560     /// Minimum primal tolerance
     1561     double minimumPrimalTolerance_;
     1562     /// Last few infeasibilities
     1563#define CLP_INFEAS_SAVE 5
     1564     double averageInfeasibility_[CLP_INFEAS_SAVE];
    15601565     /// Working copy of lower bounds (Owner of arrays below)
    15611566     double * lower_;
  • trunk/Clp/src/ClpSimplexDual.cpp

    r2103 r2115  
    135135#define NDEBUG_CLP
    136136#endif
    137 extern double minimumPrimalToleranceZZ;
    138 #define CLP_INFEAS_SAVE 5
    139 extern double averageInfeasZZ[CLP_INFEAS_SAVE];
    140137// dual
    141138
     
    604601     if (alphaAccuracy_ != -1.0)
    605602          alphaAccuracy_ = 1.0;
    606      minimumPrimalToleranceZZ=primalTolerance();
     603     minimumPrimalTolerance_=primalTolerance();
    607604     int returnCode = startupSolve(ifValuesPass, saveDuals, startFinishOptions);
    608605     // Save so can see if doing after primal
     
    43564353#endif
    43574354         primalTolerance_=1.0e-6;
    4358          minimumPrimalToleranceZZ=primalTolerance_;
     4355         minimumPrimalTolerance_=primalTolerance_;
    43594356         dblParam_[ClpPrimalTolerance]=1.0e-6;
    43604357         moreSpecialOptions_ |= 4194304;
Note: See TracChangeset for help on using the changeset viewer.