Ignore:
Timestamp:
Feb 14, 2005 2:43:00 PM (17 years ago)
Author:
forrest
Message:

minor stuff for SOS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CbcBranchActual.cpp

    r42 r59  
    309309}
    310310
    311 // Useful constructor (which are integer indices)
     311// Useful constructor (which are indices)
    312312CbcSOS::CbcSOS (CbcModel * model,  int numberMembers,
    313313           const int * which, const double * weights, int identifier,int type)
     
    321321    weights_ = new double[numberMembers_];
    322322    memcpy(members_,which,numberMembers_*sizeof(int));
    323     memcpy(weights_,weights,numberMembers_*sizeof(double));
     323    if (weights) {
     324      memcpy(weights_,weights,numberMembers_*sizeof(double));
     325    } else {
     326      for (int i=0;i<numberMembers_;i++)
     327        weights_[i]=i;
     328    }
    324329    // sort so weights increasing
    325330    CoinSort_2(weights_,weights_+numberMembers_,members_);
     
    410415  for (j=0;j<numberMembers_;j++) {
    411416    int iColumn = members_[j];
    412     if (lower[iColumn])
     417    if (lower[iColumn]&&(lower[iColumn]!=1.0||sosType_!=1))
    413418      throw CoinError("Non zero lower bound in SOS","constructor","CbcSOS");
    414419    if (lastWeight>=weights_[j]-1.0e-7)
Note: See TracChangeset for help on using the changeset viewer.