Ignore:
Timestamp:
Oct 8, 2007 8:19:01 AM (13 years ago)
Author:
forrest
Message:

fixes for bonmin and other stuff

File:
1 edited

Legend:

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

    r789 r819  
    569569}
    570570
     571
    571572// Default constructor
    572573CbcPartialNodeInfo::CbcPartialNodeInfo()
     
    591592
    592593  numberChangedBounds_ = numberChangedBounds;
    593   variables_ = new int [numberChangedBounds_];
    594   newBounds_ = new double [numberChangedBounds_];
     594  int size = numberChangedBounds_*(sizeof(double)+sizeof(int));
     595  char * temp = new char [size];
     596  newBounds_ = (double *) temp;
     597  variables_ = (int *) (newBounds_+numberChangedBounds_);
    595598
    596599  int i ;
     
    608611
    609612  numberChangedBounds_ = rhs.numberChangedBounds_;
    610   variables_ = new int [numberChangedBounds_];
    611   newBounds_ = new double [numberChangedBounds_];
     613  int size = numberChangedBounds_*(sizeof(double)+sizeof(int));
     614  char * temp = new char [size];
     615  newBounds_ = (double *) temp;
     616  variables_ = (int *) (newBounds_+numberChangedBounds_);
    612617
    613618  int i ;
     
    628633{
    629634  delete basisDiff_ ;
    630   delete [] variables_;
    631635  delete [] newBounds_;
    632636}
     
    694698
    695699  return parent_ ; }
    696 
    697700
    698701CbcNode::CbcNode() :
     
    24412444      iBestGot=-1;
    24422445      best=0.0;
     2446      /* Problem type as set by user or found by analysis.  This will be extended
     2447         0 - not known
     2448         1 - Set partitioning <=
     2449         2 - Set partitioning ==
     2450         3 - Set covering
     2451         4 - all +- 1 or all +1 and odd
     2452      */
     2453      int problemType = model->problemType();
    24432454#define PRINT_STUFF -1
    24442455      for (i=0;i<numberObjects;i++) {
     
    24882499            double part =saveSolution[iColumn]-floor(saveSolution[iColumn]);
    24892500            infeasibility = fabs(0.5-part);
     2501          }
     2502          if (problemType>0&&problemType<4) {
     2503            // try closest to 0.5
     2504            double part =saveSolution[iColumn]-floor(saveSolution[iColumn]);
     2505            infeasibility = 0.5-fabs(0.5-part);
    24902506          }
    24912507          bool gotDown=false;
Note: See TracChangeset for help on using the changeset viewer.