Changeset 1682
 Timestamp:
 Jun 29, 2011 5:05:37 AM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Cbc/src/CbcModel.cpp
r1663 r1682 2396 2396 if (numberObjects_) 2397 2397 doHeuristicsAtRoot(); 2398 #ifdef COIN_HAS_BONMIN // With some heuristics solver needs a resolve here (don't know if this is bug in heuristics) 2399 solver_>resolve(); 2400 if(!isProvenOptimal()){ 2401 solver_>initialSolve(); 2402 } 2403 #endif 2398 if (solverCharacteristics_>solutionAddsCuts()) { 2399 // With some heuristics solver needs a resolve here 2400 solver_>resolve(); 2401 if(!isProvenOptimal()){ 2402 solver_>initialSolve(); 2403 } 2404 } 2404 2405 /* 2405 2406 Grepping through the code, it would appear that this is a command line … … 2586 2587 } 2587 2588 currentNumberCuts_ = numberNewCuts_ ; 2589 if (solverCharacteristics_>solutionAddsCuts()) { 2590 // With some heuristics solver needs a resolve here (don't know if this is bug in heuristics) 2591 solver_>resolve(); 2592 if(!isProvenOptimal()){ 2593 solver_>initialSolve(); 2594 } 2595 } 2588 2596 // See if can stop on gap 2589 2597 bestPossibleObjective_ = solver_>getObjValue() * solver_>getObjSense(); … … 7099 7107 << CoinMessageEol ; 7100 7108 } 7101 #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)7109 //Is Necessary for Bonmin? Always keepGoing if cuts have been generated in last iteration (taken from similar code in Cbc2.4) 7102 7110 if (solverCharacteristics_>solutionAddsCuts()&&numberViolated) { 7103 7111 for (i = 0;i<numberCutGenerators_;i++) { … … 7109 7117 } 7110 7118 if(!keepGoing){ 7111 #endif7112 7119 // Status for single pass of cut generation 7113 7120 int status = 0; … … 7132 7139 if (!feasible) 7133 7140 violated = 2; 7134 #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) 7135 } 7136 #endif 7141 } 7137 7142 //if (!feasible) 7138 7143 //break; … … 12589 12594 #endif 12590 12595 currentNode_ = newNode; // so can be used elsewhere 12591 #ifdef COIN_HAS_BONMIN// Remember number of rows to restore at the end of the loop12596 // Remember number of rows to restore at the end of the loop 12592 12597 int saveNumberRows=solver_>getNumRows(); 12593 #endif12594 12598 /* 12595 12599 Enough preparation. Get down to the business of choosing a branching … … 12685 12689 resolve(solver_); 12686 12690 double objval = solver_>getObjValue(); 12687 #ifndef COIN_HAS_BONMIN12688 int saveNumberRows = solver_>getNumRows();12689 #endif12690 12691 lastHeuristic_ = NULL; 12691 12692 setBestSolution(CBC_SOLUTION, objval, … … 12705 12706 feasible = false; // pretend infeasible 12706 12707 } 12707 #ifndef COIN_HAS_BONMIN12708 if( saveNumberRows<solver_>getNumRows()) {12709 // delete rows  but leave solution12710 int n = solver_>getNumRows();12711 int * del = new int [nsaveNumberRows];12712 for (int i=saveNumberRows;i<n;i++)12713 del[isaveNumberRows]=i;12714 solver_>deleteRows(nsaveNumberRows,del);12715 delete [] del;12716 }12717 #endif12718 12708 if (feasible) 12719 12709 anyAction = 1; … … 12756 12746 } 12757 12747 } 12758 #ifdef COIN_HAS_BONMIN//A candidate has been found; restore the subproblem.12748 //A candidate has been found; restore the subproblem. 12759 12749 if( saveNumberRows<solver_>getNumRows()) { 12760 12750 // delete rows  but leave solution … … 12766 12756 delete [] del; 12767 12757 } 12768 #endif12769 12758 /* 12770 12759 End main loop to choose a branching variable.
Note: See TracChangeset
for help on using the changeset viewer.