Changeset 464 for branches/devel/Cbc/src


Ignore:
Timestamp:
Oct 23, 2006 1:21:24 PM (13 years ago)
Author:
forrest
Message:

fix bug I just put in fpump

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Cbc/src/CbcHeuristicFPump.cpp

    r463 r464  
    179179  const double * lower = model_->solver()->getColLower();
    180180  const double * upper = model_->solver()->getColUpper();
    181   bool doGeneral = (accumulate_&4)!=0;
     181  bool doGeneral = (accumulate_&(4+8))!=0;
    182182  j=0;
    183183  for (i=0;i<numberIntegers;i++) {
     
    199199    }
    200200  }
    201   if (general*3>numberIntegers&&!doGeneral) {
     201  if (general*3>2*numberIntegers&&!doGeneral) {
    202202    delete [] integerVariable;
    203203    return 0;
     204  } else if ((accumulate_&8)==0) {
     205    doGeneral=false;
    204206  }
     207  if (!general)
     208    doGeneral=false;
    205209  int numberIntegersOrig = numberIntegers;
    206210  numberIntegers = j;
    207   if (!doGeneral)
    208     general=0;
    209211  double * newSolution = new double [numberColumns];
    210212  double newSolutionValue=COIN_DBL_MAX;
     
    342344        if (newSolutionValue<solutionValue) {
    343345          double saveValue = newSolutionValue;
    344           if (general) {
     346          if (!doGeneral) {
    345347            int numberLeft=0;
    346348            for (i=0;i<numberIntegersOrig;i++) {
    347349              int iColumn = integerVariableOrig[i];
    348350              double value = floor(newSolution[iColumn]+0.5);
    349               if(solver->isBinary(iColumn)||general) {
     351              if(solver->isBinary(iColumn)) {
    350352                solver->setColLower(iColumn,value);
    351353                solver->setColUpper(iColumn,value);
     
    434436          // below so we can keep original code and allow for objective
    435437          int iColumn = i;
    436           if(!solver->isBinary(iColumn)&&!general)
     438          if(!solver->isBinary(iColumn)&&!doGeneral)
    437439            continue;
    438440          // deal with fixed variables (i.e., upper=lower)
     
    448450              solver->setObjCoeff(iColumn,-costValue+scaleFactor*saveObjective[iColumn]);
    449451            } else {
    450               abort();
     452              solver->setObjCoeff(iColumn,0.0);
    451453            }
    452454          }
     
    504506          }     
    505507        }
    506         if (!general) {
     508        if (!doGeneral) {
    507509          solver->resolve();
    508510          assert (solver->isProvenOptimal());
     
    602604      int nFixC=0;
    603605      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];
    606608        //const OsiObject * object = model_->object(i);
    607609        //double originalLower;
     
    663665        printf("\n");
    664666      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",
    666668             nFixI,nFixC2);
    667669      double saveValue = newSolutionValue;
Note: See TracChangeset for help on using the changeset viewer.