Changeset 867


Ignore:
Timestamp:
Feb 7, 2008 4:46:54 PM (11 years ago)
Author:
forrest
Message:

try and fix bug reported by Kim Hansen

File:
1 edited

Legend:

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

    r864 r867  
    15131513    int preferredWay ;
    15141514    int numberUnsatisfied = 0 ;
     1515    delete [] currentSolution_;
     1516    currentSolution_ = new double [numberColumns];
     1517    testSolution_ = currentSolution_;
    15151518    memcpy(currentSolution_,solver_->getColSolution(),
    15161519           numberColumns*sizeof(double)) ;
     
    37273730    continuousSolution_ = new double[numberColumns];
    37283731    usedInSolution_ = new int[numberColumns];
     3732    CoinZeroN(usedInSolution_,numberColumns);
    37293733    for (iColumn=0;iColumn<numberColumns;iColumn++) {
    37303734      if( solver_->isInteger(iColumn))
     
    40404044  if (!noTree) {
    40414045    int numberColumns = solver_->getNumCols();
    4042     currentSolution_ = CoinCopyOfArray(rhs.currentSolution_,numberColumns);
    4043     continuousSolution_ = CoinCopyOfArray(rhs.continuousSolution_,numberColumns);
    4044     usedInSolution_ = CoinCopyOfArray(rhs.usedInSolution_,numberColumns);
     4046    // Space for current solution
     4047    currentSolution_ = new double[numberColumns];
     4048    continuousSolution_ = new double[numberColumns];
     4049    usedInSolution_ = new int[numberColumns];
     4050    CoinZeroN(usedInSolution_,numberColumns);
    40454051  } else {
    40464052    currentSolution_=NULL;
     
    41444150    }
    41454151    int numberColumns = rhs.getNumCols();
    4146     currentSolution_ = CoinCopyOfArray(rhs.currentSolution_,numberColumns);
    4147     continuousSolution_ = CoinCopyOfArray(rhs.continuousSolution_,numberColumns);
    4148     usedInSolution_ = CoinCopyOfArray(rhs.usedInSolution_,numberColumns);
     4152    if (numberColumns) {
     4153      // Space for current solution
     4154      currentSolution_ = new double[numberColumns];
     4155      continuousSolution_ = new double[numberColumns];
     4156      usedInSolution_ = new int[numberColumns];
     4157      CoinZeroN(usedInSolution_,numberColumns);
     4158    } else {
     4159      currentSolution_=NULL;
     4160      continuousSolution_=NULL;
     4161      usedInSolution_=NULL;
     4162    }
    41494163    testSolution_=currentSolution_;
    41504164    minimumDrop_ = rhs.minimumDrop_;
Note: See TracChangeset for help on using the changeset viewer.