Changeset 238
 Timestamp:
 Jan 31, 2006 11:39:18 AM (14 years ago)
 Location:
 trunk
 Files:

 4 edited
Legend:
 Unmodified
 Added
 Removed

trunk/CbcBranchLotsize.cpp
r201 r238 546 546 { 547 547 OsiSolverInterface * solver = model_>solver(); 548 double value = model_>testSolution()[columnNumber_]; 549 550 assert (findRange(value)); 548 549 assert (findRange(model_>testSolution()[columnNumber_])); 551 550 double dj = solver>getObjSense()*solver>getReducedCost()[columnNumber_]; 552 551 CbcLotsizeBranchingObject * object = NULL; 
trunk/CbcCutGenerator.cpp
r208 r238 214 214 } 215 215 } 216 returnCode = !solver>basisIsAvailable(); 216 217 } 217 218 if (timing_) 
trunk/CbcModel.cpp
r231 r238 1104 1104 int saveNumber = numberIterations_; 1105 1105 feasible = solveWithCuts(cuts,maximumCutPasses_,node); 1106 if ((specialOptions_&1)!=0&&onOptimalPath) { 1107 const OsiRowCutDebugger *debugger = solver_>getRowCutDebugger() ; 1108 assert (debugger) ; 1109 } 1106 1110 if (statistics_) { 1107 1111 assert (numberNodes2_); … … 1135 1139 use variable() (i.e., presence of a branching variable). Equivalent? 1136 1140 */ 1137 if (onOptimalPath) 1141 if (onOptimalPath) { 1142 if (!feasible) { 1143 printf("infeas2\n"); 1144 solver_>writeMps("infeas"); 1145 CoinWarmStartBasis *slack = 1146 dynamic_cast<CoinWarmStartBasis *>(solver_>getEmptyWarmStart()) ; 1147 solver_>setWarmStart(slack); 1148 delete slack ; 1149 solver_>setHintParam(OsiDoReducePrint,false,OsiHintDo,0) ; 1150 solver_>initialSolve(); 1151 assert (!solver_>isProvenOptimal()); 1152 } 1138 1153 assert (feasible); 1154 } 1139 1155 bool checkingNode=false; 1140 1156 if (feasible) … … 4955 4971 int numberColumnCutsBefore = theseCuts.sizeColCuts() ; 4956 4972 if (i<numberCutGenerators_) { 4957 if (generator_[i]>normal()) { 4973 bool generate = generator_[i]>normal(); 4974 // skip if not optimal and should be (maybe a cut generator has fixed variables) 4975 if (generator_[i]>needsOptimalBasis()&&!solver_>basisIsAvailable()) 4976 generate=false; 4977 if (generate) { 4958 4978 bool mustResolve = 4959 4979 generator_[i]>generateCuts(theseCuts,fullScan,node) ; … … 5508 5528 double totalCuts = 0.0 ; 5509 5529 //#define JUST_ACTIVE 5510 for (i = 0;i<numberCutGenerators_;i++) 5530 for (i = 0;i<numberCutGenerators_;i++) { 5511 5531 if (countRowCuts[i]countColumnCuts[i]) 5512 5532 numberActiveGenerators++; … … 5516 5536 totalCuts += countRowCuts[i] + 5.0*countColumnCuts[i] ; 5517 5537 #endif 5538 } 5518 5539 double small = (0.5* totalCuts) / 5519 5540 ((double) numberActiveGenerators) ; … … 6743 6764 int lastNumberCuts=0; 6744 6765 for (i=0;i<numberCutGenerators_;i++) { 6745 if (generator_[i]>atSolution()) { 6766 bool generate = generator_[i]>atSolution(); 6767 // skip if not optimal and should be (maybe a cut generator has fixed variables) 6768 if (generator_[i]>needsOptimalBasis()&&!solver_>basisIsAvailable()) 6769 generate=false; 6770 if (generate) { 6746 6771 generator_[i]>generateCuts(theseCuts,true,NULL); 6747 6772 int numberCuts = theseCuts.sizeRowCuts(); 
trunk/include/CbcCutGenerator.hpp
r202 r238 6 6 #include "OsiSolverInterface.hpp" 7 7 #include "OsiCuts.hpp" 8 #include "CglCutGenerator.hpp" 8 9 9 10 class CbcModel; 10 11 class OsiRowCut; 11 12 class OsiRowCutDebugger; 12 class CglCutGenerator;13 13 14 14 //############################################################################# … … 205 205 inline int switchOffIfLessThan() const 206 206 { return switchOffIfLessThan_;}; 207 /// Say if optimal basis needed 208 inline bool needsOptimalBasis() const 209 { return generator_>needsOptimalBasis();}; 207 210 //@} 208 211
Note: See TracChangeset
for help on using the changeset viewer.