Changeset 812 for trunk


Ignore:
Timestamp:
Oct 1, 2007 9:48:10 PM (12 years ago)
Author:
ladanyi
Message:

Made pseudoCosts a member of OsiChooseStrong? instead of deriving OsiChooseStrong? from OsiPseudoCosts?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcLinked.cpp

    r789 r812  
    80278027  assert (solver);
    80288028  int numberObjects = solver->numberObjects();
    8029   if (numberObjects>numberObjects_) {
     8029  if (numberObjects>numberObjects()) {
    80308030    // redo useful arrays
    8031     delete [] upTotalChange_;
    8032     delete [] downTotalChange_;
    8033     delete [] upNumber_;
    8034     delete [] downNumber_;
    8035     numberObjects_ = solver->numberObjects();
    8036     upTotalChange_ = new double [numberObjects_];
    8037     downTotalChange_ = new double [numberObjects_];
    8038     upNumber_ = new int [numberObjects_];
    8039     downNumber_ = new int [numberObjects_];
    8040     CoinZeroN(upTotalChange_,numberObjects_);
    8041     CoinZeroN(downTotalChange_,numberObjects_);
    8042     CoinZeroN(upNumber_,numberObjects_);
    8043     CoinZeroN(downNumber_,numberObjects_);
    8044   }
     8031    pseudoCosts_->initialize(numberObjects);
     8032  }
     8033  int numObj = numberObjects;
    80458034  if (numberObjectsToUse_<0) {
    80468035    // Sort objects so bilinear at end
    80478036    OsiObject ** sorted = new OsiObject * [numberObjects];
    80488037    OsiObject ** objects = solver->objects();
    8049     numberObjects_=0;
     8038    numObj=0;
    80508039    int numberBiLinear=0;
    80518040    int i;
     
    80548043      OsiBiLinear * objB = dynamic_cast<OsiBiLinear *> (obj);
    80558044      if (!objB)
    8056         objects[numberObjects_++]=obj;
     8045        objects[numObj++]=obj;
    80578046      else
    80588047        sorted[numberBiLinear++]=obj;
    80598048    }
    8060     numberObjectsToUse_ = numberObjects_;
     8049    numberObjectsToUse_ = numObj;
    80618050    for (i=0;i<numberBiLinear;i++)
    8062       objects[numberObjects_++]=sorted[i];
     8051      objects[numObj++]=sorted[i];
    80638052    delete [] sorted;
    80648053    // See if any master objects
     
    80708059  }
    80718060  solver->setNumberObjects(numberObjectsToUse_);
    8072   numberObjects_=numberObjectsToUse_;
     8061  numObj=numberObjectsToUse_;
    80738062  // Use shadow prices
    80748063  //info->defaultDual_=0.0;
    80758064  int numberUnsatisfied=OsiChooseStrong::setupList ( info, initialize);
    80768065  solver->setNumberObjects(numberObjects);
    8077   numberObjects_=numberObjects;
     8066  numObj=numberObjects;
    80788067  return numberUnsatisfied;
    80798068}
Note: See TracChangeset for help on using the changeset viewer.