Changeset 464
 Timestamp:
 Oct 23, 2006 1:21:24 PM (13 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/devel/Cbc/src/CbcHeuristicFPump.cpp
r463 r464 179 179 const double * lower = model_>solver()>getColLower(); 180 180 const double * upper = model_>solver()>getColUpper(); 181 bool doGeneral = (accumulate_& 4)!=0;181 bool doGeneral = (accumulate_&(4+8))!=0; 182 182 j=0; 183 183 for (i=0;i<numberIntegers;i++) { … … 199 199 } 200 200 } 201 if (general*3> numberIntegers&&!doGeneral) {201 if (general*3>2*numberIntegers&&!doGeneral) { 202 202 delete [] integerVariable; 203 203 return 0; 204 } else if ((accumulate_&8)==0) { 205 doGeneral=false; 204 206 } 207 if (!general) 208 doGeneral=false; 205 209 int numberIntegersOrig = numberIntegers; 206 210 numberIntegers = j; 207 if (!doGeneral)208 general=0;209 211 double * newSolution = new double [numberColumns]; 210 212 double newSolutionValue=COIN_DBL_MAX; … … 342 344 if (newSolutionValue<solutionValue) { 343 345 double saveValue = newSolutionValue; 344 if ( general) {346 if (!doGeneral) { 345 347 int numberLeft=0; 346 348 for (i=0;i<numberIntegersOrig;i++) { 347 349 int iColumn = integerVariableOrig[i]; 348 350 double value = floor(newSolution[iColumn]+0.5); 349 if(solver>isBinary(iColumn) general) {351 if(solver>isBinary(iColumn)) { 350 352 solver>setColLower(iColumn,value); 351 353 solver>setColUpper(iColumn,value); … … 434 436 // below so we can keep original code and allow for objective 435 437 int iColumn = i; 436 if(!solver>isBinary(iColumn)&&! general)438 if(!solver>isBinary(iColumn)&&!doGeneral) 437 439 continue; 438 440 // deal with fixed variables (i.e., upper=lower) … … 448 450 solver>setObjCoeff(iColumn,costValue+scaleFactor*saveObjective[iColumn]); 449 451 } else { 450 abort();452 solver>setObjCoeff(iColumn,0.0); 451 453 } 452 454 } … … 504 506 } 505 507 } 506 if (! general) {508 if (!doGeneral) { 507 509 solver>resolve(); 508 510 assert (solver>isProvenOptimal()); … … 602 604 int nFixC=0; 603 605 int nFixC2=0; 604 for (i=0;i<numberIntegers ;i++) {605 int iColumn=integerVariable [i];606 for (i=0;i<numberIntegersOrig;i++) { 607 int iColumn=integerVariableOrig[i]; 606 608 //const OsiObject * object = model_>object(i); 607 609 //double originalLower; … … 663 665 printf("\n"); 664 666 else 665 printf(" of which %d were internal integer and %d internal continuous\n",667 printf(" of which %d were internal integer and %d internal continuous\n", 666 668 nFixI,nFixC2); 667 669 double saveValue = newSolutionValue;
Note: See TracChangeset
for help on using the changeset viewer.