Changeset 1340
 Timestamp:
 Dec 3, 2009 11:30:31 AM (10 years ago)
 Location:
 branches/sandbox/Cbc/src
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

branches/sandbox/Cbc/src/CbcModel.cpp
r1338 r1340 1129 1129 return ; 1130 1130 } 1131 1132 #ifdef COIN_HAS_CLP1133 /*1134 Change pivot method of required. Called from BranchandBound()1135 */1136 void CbcModel::possiblePivotMethodChange( ClpDualRowPivot ** savePivotMethod, int lower, int upper)1137 {1138 OsiClpSolverInterface * clpSolver1139 = dynamic_cast<OsiClpSolverInterface *> (solver_);1140 if (clpSolver && numberNodes_ >= lower && numberNodes_ < upper) {1141 if (numberIterations_ < (numberSolves_ + numberNodes_)*10) {1142 //if (numberIterations_<numberNodes_*20) {1143 ClpSimplex * simplex = clpSolver>getModelPtr();1144 ClpDualRowPivot * pivotMethod = simplex>dualRowPivot();1145 ClpDualRowDantzig * pivot =1146 dynamic_cast< ClpDualRowDantzig*>(pivotMethod);1147 if (!pivot) {1148 *savePivotMethod = pivotMethod>clone(true);1149 ClpDualRowDantzig dantzig;1150 simplex>setDualRowPivotAlgorithm(dantzig);1151 #ifdef COIN_DEVELOP1152 printf("%d node, %d iterations >Dantzig\n", numberNodes_,1153 numberIterations_);1154 #endif1155 #ifdef CBC_THREAD1156 #if 01157 /* FIXME: threadInfo is out of scope! */1158 for (int i = 0; i < numberThreads_; i++) {1159 threadInfo[i].dantzigState = 1;1160 }1161 #endif1162 #endif1163 }1164 }1165 }1166 }1167 #endif // COIN_HAS_CLP1168 1131 1169 1132 /* … … 3412 3375 // Possible change of pivot method 3413 3376 if (!savePivotMethod && !parentModel_) { 3414 possiblePivotMethodChange( &savePivotMethod, 100, 200); 3377 OsiClpSolverInterface * clpSolver 3378 = dynamic_cast<OsiClpSolverInterface *> (solver_); 3379 if (clpSolver && numberNodes_ >= 100 && numberNodes_ < 200) { 3380 if (numberIterations_ < (numberSolves_ + numberNodes_)*10) { 3381 //if (numberIterations_<numberNodes_*20) { 3382 ClpSimplex * simplex = clpSolver>getModelPtr(); 3383 ClpDualRowPivot * pivotMethod = simplex>dualRowPivot(); 3384 ClpDualRowDantzig * pivot = 3385 dynamic_cast< ClpDualRowDantzig*>(pivotMethod); 3386 if (!pivot) { 3387 savePivotMethod = pivotMethod>clone(true); 3388 ClpDualRowDantzig dantzig; 3389 simplex>setDualRowPivotAlgorithm(dantzig); 3390 #ifdef COIN_DEVELOP 3391 printf("%d node, %d iterations >Dantzig\n", numberNodes_, 3392 numberIterations_); 3393 #endif 3394 #ifdef CBC_THREAD 3395 for (int i = 0; i < numberThreads_; i++) { 3396 threadInfo[i].dantzigState = 1; 3397 } 3398 #endif 3399 } 3400 } 3401 } 3415 3402 } 3416 3403 #endif … … 3794 3781 // Possible change of pivot method 3795 3782 if (!savePivotMethod && !parentModel_) { 3796 possiblePivotMethodChange( &savePivotMethod, 1000, 2000); 3783 OsiClpSolverInterface * clpSolver 3784 = dynamic_cast<OsiClpSolverInterface *> (solver_); 3785 if (clpSolver && numberNodes_ >= 1000 && numberNodes_ < 2000) { 3786 if (numberIterations_ < (numberSolves_ + numberNodes_)*10) { 3787 //if (numberIterations_<numberNodes_*20) { 3788 ClpSimplex * simplex = clpSolver>getModelPtr(); 3789 ClpDualRowPivot * pivotMethod = simplex>dualRowPivot(); 3790 ClpDualRowDantzig * pivot = 3791 dynamic_cast< ClpDualRowDantzig*>(pivotMethod); 3792 if (!pivot) { 3793 savePivotMethod = pivotMethod>clone(true); 3794 ClpDualRowDantzig dantzig; 3795 simplex>setDualRowPivotAlgorithm(dantzig); 3796 #ifdef COIN_DEVELOP 3797 printf("%d node, %d iterations >Dantzig\n", numberNodes_, 3798 numberIterations_); 3799 #endif 3800 #ifdef CBC_THREAD 3801 for (int i = 0; i < numberThreads_; i++) { 3802 threadInfo[i].dantzigState = 1; 3803 } 3804 #endif 3805 } 3806 } 3807 } 3797 3808 } 3798 3809 #endif 
branches/sandbox/Cbc/src/CbcModel.hpp
r1332 r1340 445 445 void saveModel(OsiSolverInterface * saveSolver, double * checkCutoffForRestart, bool * feasible); 446 446 447 #ifdef COIN_HAS_CLP448 void possiblePivotMethodChange( ClpDualRowPivot ** savePivotMethod, int lower, int upper);449 #endif450 447 //@} 451 448
Note: See TracChangeset
for help on using the changeset viewer.