Ignore:
Timestamp:
Mar 25, 2011 3:05:04 PM (8 years ago)
Author:
forrest
Message:

allow for elapsed time on unix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcModel.cpp

    r1621 r1623  
    15721572{
    15731573    /*
    1574       Capture a time stamp before we start.
     1574      Capture a time stamp before we start (unless set).
    15751575    */
    1576     dblParam_[CbcStartSeconds] = CoinGetTimeOfDay();
     1576    if (!dblParam_[CbcStartSeconds]) {
     1577      if (!useElapsedTime())
     1578        dblParam_[CbcStartSeconds] = CoinCpuTime();
     1579      else
     1580        dblParam_[CbcStartSeconds] = CoinGetTimeOfDay();
     1581    }
    15771582    dblParam_[CbcSmallestChange] = COIN_DBL_MAX;
    15781583    dblParam_[CbcSumChange] = 0.0;
     
    59725977    bool sameProblem = false;
    59735978    if ((specialOptions_&4096) == 0) {
     5979#if 0
    59745980        {
    59755981            int n1 = numberRowsAtContinuous_;
     
    59815987            //printf("ROWS a %d - old thinks %d new %d\n",solver_->getNumRows(),n1,n2);
    59825988        }
     5989#endif
    59835990        int nDel = 0;
    59845991        int nAdd = 0;
     
    66876694            assert (jObject < numberObjects_ && iObject == jObject);
    66886695#else
    6689 #ifdef TIGHTEN_BOUNDS
     6696#ifdef CBCMODEL_TIGHTEN_BOUNDS
    66906697            int iColumn = simpleObject->columnNumber();
    66916698#endif
     
    66946701            // Care! We must be careful not to update the same variable in parallel threads.
    66956702            addUpdateInformation(update);
    6696             //#define TIGHTEN_BOUNDS
    6697 #ifdef TIGHTEN_BOUNDS
     6703            //#define CBCMODEL_TIGHTEN_BOUNDS
     6704#ifdef CBCMODEL_TIGHTEN_BOUNDS
    66986705            double cutoff = getCutoff() ;
    66996706            if (feasible && cutoff < 1.0e20) {
     
    73177324            if ( maximumSecondsReached() ) {
    73187325                numberTries = 0; // exit
     7326                feasible = false;
    73197327                break;
    73207328            }
     
    1218512193CbcModel::getCurrentSeconds() const
    1218612194{
    12187     return CoinGetTimeOfDay() - getDblParam(CbcStartSeconds);
     12195    if (!useElapsedTime())
     12196      return CoinCpuTime() - getDblParam(CbcStartSeconds);
     12197    else
     12198      return CoinGetTimeOfDay() - getDblParam(CbcStartSeconds);
    1218812199}
    1218912200/* Encapsulates choosing a variable -
Note: See TracChangeset for help on using the changeset viewer.