Changeset 1364 for branches/sandbox/Cbc/src/CbcHeuristicFPump.cpp
 Timestamp:
 Dec 5, 2009 10:54:48 AM (10 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/sandbox/Cbc/src/CbcHeuristicFPump.cpp
r1286 r1364 221 221 char pumpPrint[LEN_PRINT]; 222 222 pumpPrint[0] = '\0'; 223 /* 224 Decide if we want to run. Standard values for when are described in 225 CbcHeuristic.hpp. If we're off, or running only at root and this isn't the 226 root, bail out. 227 228 The double test (against phase, then atRoot and passNumber) has a fair bit 229 of redundancy, but the results will differ depending on whether we're 230 actually at the root of the main search tree or at the root of a small tree 231 (recursive call to branchAndBound). 232 233 FPump also supports some exotic values (11  15) for when, described in 234 CbcHeuristicFPump.hpp. 235 */ 223 236 if (!when()  (when() == 1 && model_>phase() != 1)) 224 237 return 0; // switched off … … 283 296 int numberIterationsLastPass = 0; 284 297 // 1. initially check 01 298 /* 299 I'm skeptical of the above comment, but it's likely accurate as the default. 300 Bit 4 or bit 8 needs to be set in order to consider working with general 301 integers. 302 */ 285 303 int i, j; 286 304 int general = 0; … … 290 308 bool doGeneral = (accumulate_ & 4) != 0; 291 309 j = 0; 310 /* 311 Scan the objects, recording the columns and counting general integers. 312 313 Seems like the NDEBUG tests could be made into an applicability test. If 314 a scan of the objects reveals complex objects, just clean up and return 315 failure. 316 */ 292 317 for (i = 0; i < numberIntegers; i++) { 293 318 int iColumn = integerVariableOrig[i]; … … 308 333 } 309 334 } 335 /* 336 If 2/3 of integers are general integers, and we're not going to work with 337 them, might as well go home. 338 339 The else case is unclear to me. We reach it if general integers are less than 340 2/3 of the total, or if either of bit 4 or 8 is set. But only bit 8 is used 341 in the decision. (Let manyGen = 1 if more than 2/3 of integers are general 342 integers. Then a kmap on manyGen, bit4, and bit8 shows it clearly.) 343 344 So there's something odd here. In the case where bit4 = 1 and bit8 = 0, 345 we've included general integers in integerVariable, but we're not going to 346 process them. 347 */ 310 348 if (general*3 > 2*numberIntegers && !doGeneral) { 311 349 delete [] integerVariable; … … 326 364 printf("DOing general with %d out of %d\n", general, numberIntegers); 327 365 #endif 366 /* 367 This `closest solution' will satisfy integrality, but violate some other 368 constraints? 369 */ 328 370 // For solution closest to feasible if none found 329 371 int * closestSolution = general ? NULL : new int[numberIntegers]; … … 345 387 } 346 388 double time1 = CoinCpuTime(); 389 /* 390 Obtain a relaxed lp solution. 391 */ 347 392 model_>solver()>resolve(); 348 393 if (!model_>solver()>isProvenOptimal()) { … … 363 408 } 364 409 } 410 /* 411 I have no idea why we're doing this, except perhaps that saveBasis will be 412 automagically deleted on exit from the routine. 413 */ 365 414 CoinWarmStartBasis saveBasis; 366 415 CoinWarmStartBasis * basis = … … 638 687 // 5. MAIN WHILE LOOP 639 688 //bool newLineNeeded=false; 689 /* 690 finished occurs exactly twice in this routine: immediately above, where it's 691 set to false, and here in the loop condition. 692 */ 640 693 while (!finished) { 641 694 double newTrueSolutionValue = 0.0; … … 1965 2018 } 1966 2019 } 2020 /* 2021 End of the `exitAll' loop. 2022 */ 1967 2023 #ifdef RAND_RAND 1968 2024 delete [] randomFactor;
Note: See TracChangeset
for help on using the changeset viewer.