Changeset 2035 for stable


Ignore:
Timestamp:
Jun 16, 2014 8:12:32 AM (5 years ago)
Author:
forrest
Message:

fix compiler warnings and try and help with quadratic IP

Location:
stable/1.15/Clp/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable/1.15/Clp/src/ClpModel.cpp

    r2027 r2035  
    45074507          infeasibilityCost_ = rhs.infeasibilityCost_;
    45084508          pivotTolerance_ = rhs.pivotTolerance_;
    4509           zeroFactorizationTolerance_ = zeroFactorizationTolerance_;
    4510           zeroSimplexTolerance_ = zeroSimplexTolerance_;
     4509          zeroFactorizationTolerance_ = rhs.zeroFactorizationTolerance_;
     4510          zeroSimplexTolerance_ = rhs.zeroSimplexTolerance_;
    45114511          acceptablePivot_ = rhs.acceptablePivot_;
    45124512          objectiveScale_ = rhs.objectiveScale_;
  • stable/1.15/Clp/src/ClpPredictorCorrector.cpp

    r1959 r2035  
    413413          double relativeMultiplier = 1.0 + fabs(primalObjective_) + fabs(dualObjective_);
    414414          // Quadratic coding is rubbish so be more forgiving?
    415           if (quadraticObj)
     415          double gapO2 = gapO;
     416          if (quadraticObj) {
    416417            relativeMultiplier *= 5.0;
    417           if (gapO < 1.0e-5 + 1.0e-9 * relativeMultiplier
     418            CoinWorkDouble largestObjective;
     419            if (CoinAbs(primalObjective_) > CoinAbs(dualObjective_)) {
     420              largestObjective = CoinAbs(primalObjective_);
     421            } else {
     422              largestObjective = CoinAbs(dualObjective_);
     423            }
     424            if (largestObjective < 1.0) {
     425              largestObjective = 1.0;
     426            }
     427            gapO2 = CoinAbs(primalObjective_ - dualObjective_) / largestObjective;
     428          }
     429          if (gapO2 < 1.0e-5 + 1.0e-9 * relativeMultiplier
    418430              || complementarityGap_ < 0.1 + 1.0e-9 * relativeMultiplier)
    419431              sloppyOptimal2 = true;
    420           if ((gapO < 1.0e-6 || (gapO < 1.0e-4 && complementarityGap_ < 0.1)) && !sloppyOptimal) {
     432          if ((gapO2 < 1.0e-6 || (gapO2 < 1.0e-4 && complementarityGap_ < 0.1)) && !sloppyOptimal) {
     433               // save solution if none saved
     434               if (saveIteration<0) {
     435                 saveIteration = numberIterations_;
     436                 if (!savePi) {
     437                   savePi = new CoinWorkDouble[numberRows_];
     438                   savePrimal = new CoinWorkDouble [numberTotal];
     439                 }
     440                 CoinMemcpyN(dualArray, numberRows_, savePi);
     441                 CoinMemcpyN(solution_, numberTotal, savePrimal);
     442               }
    421443               sloppyOptimal = true;
    422444               sloppyOptimal2 = true;
  • stable/1.15/Clp/src/OsiClp/OsiClpSolverInterface.cpp

    r1928 r2035  
    67936793      assert (arrayI[0]==nBound);
    67946794      arrayI[0]=nBound; // same
    6795       spareArrays_ = spareArrays_;
     6795      spareArrays_ = spareArrays;
    67966796      spareArrays=NULL;
    67976797#endif
Note: See TracChangeset for help on using the changeset viewer.