Changeset 2046


Ignore:
Timestamp:
Aug 14, 2014 12:13:10 AM (5 years ago)
Author:
tkr
Message:

Merging r2045 from stable/1.15. Whoops, meant to commit it to trunk

Location:
trunk/Clp
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp

  • trunk/Clp/src

  • trunk/Clp/src/ClpModel.cpp

    r2030 r2046  
    131131     dblParam_[ClpObjOffset] = 0.0;
    132132     dblParam_[ClpMaxSeconds] = -1.0;
     133     dblParam_[ClpMaxWallSeconds] = -1.0;
    133134     dblParam_[ClpPresolveTolerance] = 1.0e-8;
    134135
     
    768769     dblParam_[ClpObjOffset] = rhs.dblParam_[ClpObjOffset];
    769770     dblParam_[ClpMaxSeconds] = rhs.dblParam_[ClpMaxSeconds];
     771     dblParam_[ClpMaxWallSeconds] = rhs.dblParam_[ClpMaxWallSeconds];
    770772     dblParam_[ClpPresolveTolerance] = rhs.dblParam_[ClpPresolveTolerance];
    771773#ifndef CLP_NO_STD
     
    11061108          if(value >= 0)
    11071109               value += CoinCpuTime();
     1110          else
     1111               value = -1.0;
     1112          break;
     1113
     1114     case ClpMaxWallSeconds:
     1115          if(value >= 0)
     1116               value += CoinWallclockTime();
    11081117          else
    11091118               value = -1.0;
     
    28192828          dblParam_[ClpMaxSeconds] = -1.0;
    28202829}
     2830void
     2831ClpModel::setMaximumWallSeconds(double value)
     2832{
     2833     if(value >= 0)
     2834          dblParam_[ClpMaxWallSeconds] = value + CoinWallclockTime();
     2835     else
     2836          dblParam_[ClpMaxWallSeconds] = -1.0;
     2837}
    28212838// Returns true if hit maximum iterations (or time)
    28222839bool
     
    28282845          hitMax = (CoinCpuTime() >= dblParam_[ClpMaxSeconds]);
    28292846     }
     2847     if (dblParam_[ClpMaxWallSeconds] >= 0.0 && !hitMax) {
     2848          hitMax = (CoinWallclockTime() >= dblParam_[ClpMaxWallSeconds]);
     2849     }
    28302850     return hitMax;
    28312851}
     
    28362856     if (problemStatus_ == 3) {
    28372857          secondaryStatus_ = 0;
    2838           if (CoinCpuTime() >= dblParam_[ClpMaxSeconds] && dblParam_[ClpMaxSeconds] >= 0.0)
     2858          if ((CoinCpuTime() >= dblParam_[ClpMaxSeconds] && dblParam_[ClpMaxSeconds] >= 0.0) ||
     2859              (CoinWallclockTime() >= dblParam_[ClpMaxWallSeconds] && dblParam_[ClpMaxWallSeconds] >= 0.0))
    28392860               secondaryStatus_ = 9;
    28402861     }
     
    33323353     dblParam_[ClpObjOffset] = rhs->dblParam_[ClpObjOffset];
    33333354     dblParam_[ClpMaxSeconds] = rhs->dblParam_[ClpMaxSeconds];
     3355     dblParam_[ClpMaxWallSeconds] = rhs->dblParam_[ClpMaxWallSeconds];
    33343356     dblParam_[ClpPresolveTolerance] = rhs->dblParam_[ClpPresolveTolerance];
    33353357#ifndef CLP_NO_STD
  • trunk/Clp/src/ClpModel.hpp

    r1972 r2046  
    387387     }
    388388     void setMaximumSeconds(double value);
     389     void setMaximumWallSeconds(double value);
    389390     /// Returns true if hit maximum iterations (or time)
    390391     bool hitMaximumIterations() const;
  • trunk/Clp/src/ClpParameters.hpp

    r1665 r2046  
    5959         the objective function. */
    6060     ClpObjOffset,
    61      /// Maximum time in seconds - after this action is as max iterations
     61     /// Maximum time in seconds - after, this action is as max iterations
    6262     ClpMaxSeconds,
     63     /// Maximum wallclock running time in seconds - after, this action is as max iterations
     64     ClpMaxWallSeconds,
    6365     /// Tolerance to use in presolve
    6466     ClpPresolveTolerance,
  • trunk/Clp/src/OsiClp

  • trunk/Clp/src/OsiClp/OsiClpSolverInterface.cpp

    r2030 r2046  
    16211621bool OsiClpSolverInterface::isIterationLimitReached() const
    16221622{
    1623   const int stat = modelPtr_->status();
    1624   return (stat == 3);
     1623  const int status = modelPtr_->status();
     1624  const int secondaryStatus = modelPtr_->secondaryStatus();
     1625  return (status == 3 && secondaryStatus == 0);
    16251626}
    16261627
Note: See TracChangeset for help on using the changeset viewer.