Changeset 589 for trunk/ClpPresolve.cpp


Ignore:
Timestamp:
Apr 6, 2005 2:54:16 PM (15 years ago)
Author:
forrest
Message:

for presolve memory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpPresolve.cpp

    r582 r589  
    963963
    964964  // temporary init
    965   mrstrt_(new CoinBigIndex[nrows_in+1]),
    966   hinrow_(new int[nrows_in+1]),
    967   rowels_(new double[2*nelems_in]),
    968   hcol_(new int[2*nelems_in]),
    969965  integerType_(new unsigned char[ncols0_in]),
    970966  tuning_(false),
     
    10191015  mRow->removeGaps();
    10201016
    1021 
    1022   ClpDisjointCopyN(mRow->getVectorStarts(),  nrows_,  mrstrt_);
     1017  // Now get rid of matrix
     1018  si->createEmptyMatrix();
     1019
     1020  double * el = mRow->getMutableElements();
     1021  int * ind = mRow->getMutableIndices();
     1022  CoinBigIndex * strt = mRow->getMutableVectorStarts();
     1023  int * len = mRow->getMutableVectorLengths();
     1024  // Do carefully to save memory
     1025  rowels_ = new double[2*nelems_in];
     1026  ClpDisjointCopyN(el,      nelems_, rowels_);
     1027  mRow->nullElementArray();
     1028  delete [] el;
     1029  hcol_ = new int[2*nelems_in];
     1030  ClpDisjointCopyN(ind,       nelems_, hcol_);
     1031  mRow->nullIndexArray();
     1032  delete [] ind;
     1033  mrstrt_ = new CoinBigIndex[nrows_in+1];
     1034  ClpDisjointCopyN(strt,  nrows_,  mrstrt_);
     1035  mRow->nullStartArray();
    10231036  mrstrt_[nrows_] = nelems_;
    1024   ClpDisjointCopyN(mRow->getVectorLengths(), nrows_,  hinrow_);
    1025   ClpDisjointCopyN(mRow->getIndices(),       nelems_, hcol_);
    1026   ClpDisjointCopyN(mRow->getElements(),      nelems_, rowels_);
     1037  delete [] strt;
     1038  hinrow_ = new int[nrows_in+1];
     1039  ClpDisjointCopyN(len, nrows_,  hinrow_);
    10271040
    10281041  delete mRow;
     
    13331346    if (saveFile_=="") {
    13341347      delete presolvedModel_;
     1348      // So won't get names
     1349      int lengthNames = originalModel->lengthNames();
     1350      originalModel->setLengthNames(0);
    13351351      presolvedModel_ = new ClpSimplex(*originalModel);
     1352      originalModel->setLengthNames(lengthNames);
    13361353    } else {
    13371354      presolvedModel_=originalModel;
Note: See TracChangeset for help on using the changeset viewer.