 Timestamp:
 Jun 5, 2007 3:30:01 AM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/devel/Cbc/src/CbcStrategy.cpp
r539 r617 37 37 38 38 #include "CbcHeuristic.hpp" 39 #include "CbcHeuristicLocal.hpp" 39 40 40 41 // Default Constructor … … 257 258 258 259 CbcRounding heuristic1(model); 260 heuristic1.setHeuristicName("rounding"); 259 261 int numberHeuristics = model.numberHeuristics(); 260 262 int iHeuristic; … … 271 273 if (!found) 272 274 model.addHeuristic(&heuristic1); 275 #if 0 276 // Allow join solutions 277 CbcHeuristicLocal heuristic2(model); 278 heuristic2.setHeuristicName("join solutions"); 279 heuristic2.setSearchType(1); 280 found=false; 281 for (iHeuristic=0;iHeuristic<numberHeuristics;iHeuristic++) { 282 CbcHeuristic * heuristic = model.heuristic(iHeuristic); 283 CbcHeuristicLocal * cgl = dynamic_cast<CbcHeuristicLocal *>(heuristic); 284 if (cgl) { 285 found=true; 286 break; 287 } 288 } 289 if (!found) 290 model.addHeuristic(&heuristic2); 291 #endif 273 292 } 274 293 // Do printing stuff … … 302 321 process>passInMessageHandler(model.messageHandler()); 303 322 OsiSolverInterface * solver = model.solver(); 323 { 324 // mark some columns as ineligible for presolve 325 int numberColumns = solver>getNumCols(); 326 char * prohibited = new char[numberColumns]; 327 memset(prohibited,0,numberColumns); 328 int numberProhibited=0; 329 // convert to Cbc integers 330 model.findIntegers(false); 331 int numberObjects = model.numberObjects(); 332 if (numberObjects) { 333 OsiObject ** objects = model.objects(); 334 for (int iObject=0;iObject<numberObjects;iObject++) { 335 CbcSOS * obj = 336 dynamic_cast <CbcSOS *>(objects[iObject]) ; 337 if (obj) { 338 // SOS 339 int n = obj>numberMembers(); 340 const int * which = obj>members(); 341 for (int i=0;i<n;i++) { 342 int iColumn = which[i]; 343 prohibited[iColumn]=1; 344 numberProhibited++; 345 } 346 } 347 } 348 } 349 if (numberProhibited) 350 process>passInProhibited(prohibited,numberColumns); 351 delete [] prohibited; 352 } 304 353 int logLevel = model.messageHandler()>logLevel(); 305 354 #ifdef COIN_HAS_CLP … … 707 756 708 757 CbcRounding heuristic1(model); 758 heuristic1.setHeuristicName("rounding"); 709 759 int numberHeuristics = model.numberHeuristics(); 710 760 int iHeuristic;
Note: See TracChangeset
for help on using the changeset viewer.