Changeset 2267


Ignore:
Timestamp:
Feb 21, 2016 6:26:51 AM (3 years ago)
Author:
forrest
Message:

don't create zero length arrays

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/2.9/Cbc/src/CbcModel.cpp

    r2258 r2267  
    61646164    }
    61656165    // Space for current solution
    6166     currentSolution_ = new double[numberColumns];
    6167     continuousSolution_ = CoinCopyOfArray(solver_->getColSolution(),numberColumns);
    6168     usedInSolution_ = new int[numberColumns];
    6169     CoinZeroN(usedInSolution_, numberColumns);
     6166    if (numberColumns) {
     6167      currentSolution_ = new double[numberColumns];
     6168      continuousSolution_ = CoinCopyOfArray(solver_->getColSolution(),numberColumns);
     6169      usedInSolution_ = new int[numberColumns];
     6170      CoinZeroN(usedInSolution_, numberColumns);
     6171    } else {
     6172      currentSolution_ = NULL;
     6173      continuousSolution_ = NULL;
     6174      usedInSolution_ = NULL;
     6175    }
    61706176    testSolution_ = currentSolution_;
    61716177    numberRowsAtContinuous_ = rhs.numberRowsAtContinuous_;
Note: See TracChangeset for help on using the changeset viewer.