- Timestamp:
- Mar 25, 2011 3:05:04 PM (10 years ago)
- Location:
- trunk/Cbc/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cbc/src/CbcModel.cpp
r1621 r1623 1572 1572 { 1573 1573 /* 1574 Capture a time stamp before we start .1574 Capture a time stamp before we start (unless set). 1575 1575 */ 1576 dblParam_[CbcStartSeconds] = CoinGetTimeOfDay(); 1576 if (!dblParam_[CbcStartSeconds]) { 1577 if (!useElapsedTime()) 1578 dblParam_[CbcStartSeconds] = CoinCpuTime(); 1579 else 1580 dblParam_[CbcStartSeconds] = CoinGetTimeOfDay(); 1581 } 1577 1582 dblParam_[CbcSmallestChange] = COIN_DBL_MAX; 1578 1583 dblParam_[CbcSumChange] = 0.0; … … 5972 5977 bool sameProblem = false; 5973 5978 if ((specialOptions_&4096) == 0) { 5979 #if 0 5974 5980 { 5975 5981 int n1 = numberRowsAtContinuous_; … … 5981 5987 //printf("ROWS a %d - old thinks %d new %d\n",solver_->getNumRows(),n1,n2); 5982 5988 } 5989 #endif 5983 5990 int nDel = 0; 5984 5991 int nAdd = 0; … … 6687 6694 assert (jObject < numberObjects_ && iObject == jObject); 6688 6695 #else 6689 #ifdef TIGHTEN_BOUNDS6696 #ifdef CBCMODEL_TIGHTEN_BOUNDS 6690 6697 int iColumn = simpleObject->columnNumber(); 6691 6698 #endif … … 6694 6701 // Care! We must be careful not to update the same variable in parallel threads. 6695 6702 addUpdateInformation(update); 6696 //#define TIGHTEN_BOUNDS6697 #ifdef TIGHTEN_BOUNDS6703 //#define CBCMODEL_TIGHTEN_BOUNDS 6704 #ifdef CBCMODEL_TIGHTEN_BOUNDS 6698 6705 double cutoff = getCutoff() ; 6699 6706 if (feasible && cutoff < 1.0e20) { … … 7317 7324 if ( maximumSecondsReached() ) { 7318 7325 numberTries = 0; // exit 7326 feasible = false; 7319 7327 break; 7320 7328 } … … 12185 12193 CbcModel::getCurrentSeconds() const 12186 12194 { 12187 return CoinGetTimeOfDay() - getDblParam(CbcStartSeconds); 12195 if (!useElapsedTime()) 12196 return CoinCpuTime() - getDblParam(CbcStartSeconds); 12197 else 12198 return CoinGetTimeOfDay() - getDblParam(CbcStartSeconds); 12188 12199 } 12189 12200 /* Encapsulates choosing a variable - -
trunk/Cbc/src/CbcModel.hpp
r1585 r1623 1737 1737 32768 more heuristics in sub trees 1738 1738 65536 no cuts in preprocessing 1739 131072 Time limits elapsed 1739 1740 */ 1740 1741 inline void setMoreSpecialOptions(int value) { … … 1744 1745 inline int moreSpecialOptions() const { 1745 1746 return moreSpecialOptions_; 1747 } 1748 /// Set time method 1749 inline void setUseElapsedTime(bool yesNo) { 1750 if (yesNo) 1751 moreSpecialOptions_ |= 131072; 1752 else 1753 moreSpecialOptions_ &= ~131072; 1754 } 1755 /// Get time method 1756 inline bool useElapsedTime() const { 1757 return (moreSpecialOptions_&131072)!=0; 1746 1758 } 1747 1759 /// Go to dantzig pivot selection if easy problem (clp only) … … 2436 2448 int specialOptions_; 2437 2449 /** More special options 2438 at present bottom 3 bits used for shadow price mode 2450 at present bottom 6 bits used for shadow price mode 2451 1024 for experimental hotstart 2452 2048,4096 breaking out of cuts 2453 8192 slowly increase minimum drop 2454 16384 gomory 2455 32768 more heuristics in sub trees 2456 65536 no cuts in preprocessing 2457 131072 Time limits elapsed 2439 2458 */ 2440 2459 int moreSpecialOptions_; -
trunk/Cbc/src/CbcSolver.cpp
r1622 r1623 1193 1193 } 1194 1194 double time0; 1195 double time0Elapsed = CoinGetTimeOfDay(); 1195 1196 { 1196 1197 double time1 = CoinCpuTime(), time2; … … 1746 1747 numberGoodCommands++; 1747 1748 if (type == CBC_PARAM_ACTION_BAB && goodModel) { 1749 if (model_.useElapsedTime()) 1748 1750 model_.setDblParam(CbcModel::CbcStartSeconds, CoinGetTimeOfDay()); 1751 else 1752 model_.setDblParam(CbcModel::CbcStartSeconds, CoinCpuTime()); 1749 1753 // check if any integers 1750 1754 #ifndef CBC_OTHER_SOLVER … … 2245 2249 crossover = action; 2246 2250 break; 2251 case CLP_PARAM_STR_TIME_MODE: 2252 model_.setUseElapsedTime(action!=0); 2253 break; 2247 2254 case CBC_PARAM_STR_SOS: 2248 2255 doSOS = action; … … 2694 2701 sprintf(generalPrint + strlen(generalPrint), 2695 2702 "Time (Wallclock Seconds): %.2f\n", 2696 model_.getCurrentSeconds());2703 CoinGetTimeOfDay()-time0Elapsed); 2697 2704 #endif 2698 2705 generalMessageHandler->message(CLP_GENERAL, generalMessages)
Note: See TracChangeset
for help on using the changeset viewer.