 Timestamp:
 Jun 10, 2011 12:03:06 PM (8 years ago)
 Location:
 stable/2.7/Cbc/src
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

stable/2.7/Cbc/src/CbcEventHandler.hpp
r1573 r1664 147 147 /*! \brief Default constructor. */ 148 148 149 CbcEventHandler(CbcModel *model = NULL) ;149 CbcEventHandler(CbcModel *model = 0) ; 150 150 151 151 /*! \brief Copy constructor. */ 
stable/2.7/Cbc/src/CbcModel.cpp
r1573 r1664 2384 2384 stoppedOnGap_ = false ; 2385 2385 // See if can stop on gap 2386 #ifdef COIN_HAS_BONMIN // With some heuristics solver needs a resolve here (don't know if this is bug in heuristics) 2387 solver_>resolve(); 2388 if(!isProvenOptimal()){ 2389 solver_>initialSolve(); 2390 } 2391 #endif 2386 2392 bestPossibleObjective_ = solver_>getObjValue() * solver_>getObjSense(); 2387 2393 double testGap = CoinMax(dblParam_[CbcAllowableGap], … … 7064 7070 << CoinMessageEol ; 7065 7071 } 7072 7073 #ifdef COIN_HAS_BONMIN //Is Necessary for Bonmin? Always keepGoing if cuts have been generated in last iteration (taken from similar code in Cbc2.4) 7074 if (solverCharacteristics_>solutionAddsCuts()&&numberViolated) { 7075 for (i = 0;i<numberCutGenerators_;i++) { 7076 if (generator_[i]>mustCallAgain()) { 7077 keepGoing=true; // say must go round 7078 break; 7079 } 7080 } 7081 } 7082 if(!keepGoing){ 7083 #endif 7066 7084 // Status for single pass of cut generation 7067 7085 int status = 0; … … 7086 7104 if (!feasible) 7087 7105 violated = 2; 7106 #ifdef COIN_HAS_BONMIN //Is Necessary for Bonmin? Always keepGoing if cuts have been generated in last iteration (taken from similar code in Cbc2.4) 7107 } 7108 #endif 7088 7109 //if (!feasible) 7089 7110 //break; … … 10803 10824 delete [] saveLower; 10804 10825 delete [] saveUpper; 10826 solver_>resolve(); 10805 10827 } 10806 10828 //If the variables were fixed the cutting plane procedure may have believed that the node could be fathomed … … 12273 12295 variable. 12274 12296 */ 12297 #ifdef COIN_HAS_BONMIN // Remember number of rows to restore at the end of the loop 12298 int saveNumberRows=solver_>getNumRows(); 12299 #endif 12275 12300 while (anyAction == 1) { 12276 12301 // Set objective value (not so obvious if NLP etc) … … 12362 12387 resolve(solver_); 12363 12388 double objval = solver_>getObjValue(); 12364 int saveNumberRows=solver_>getNumRows(); 12389 #ifndef COIN_HAS_BONMIN 12390 int saveNumberRows = solver_>getNumRows(); 12391 #endif 12365 12392 lastHeuristic_ = NULL; 12366 12393 setBestSolution(CBC_SOLUTION, objval, … … 12380 12407 feasible = false; // pretend infeasible 12381 12408 } 12409 #ifndef COIN_HAS_BONMIN 12382 12410 if( saveNumberRows<solver_>getNumRows()) { 12383 12411 // delete rows  but leave solution … … 12389 12417 delete [] del; 12390 12418 } 12419 #endif 12391 12420 if (feasible) 12392 12421 anyAction = 1; … … 12429 12458 } 12430 12459 } 12460 #ifdef COIN_HAS_BONMIN //A candidate has been found; restore the subproblem. 12461 if( saveNumberRows<solver_>getNumRows()) { 12462 // delete rows  but leave solution 12463 int n = solver_>getNumRows(); 12464 int * del = new int [nsaveNumberRows]; 12465 for (int i=saveNumberRows;i<n;i++) 12466 del[isaveNumberRows]=i; 12467 solver_>deleteRows(nsaveNumberRows,del); 12468 delete [] del; 12469 } 12470 #endif 12431 12471 /* 12432 12472 End main loop to choose a branching variable.
Note: See TracChangeset
for help on using the changeset viewer.