Changeset 516 for trunk/ClpPresolve.cpp


Ignore:
Timestamp:
Nov 24, 2004 4:39:21 PM (15 years ago)
Author:
forrest
Message:

scaling limits and fix for presolve with gaps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpPresolve.cpp

    r501 r516  
    11921192  const CoinPackedMatrix * m = si->matrix();
    11931193
     1194  const CoinBigIndex nelemsr = m->getNumElements();
    11941195  if (! isGapFree(*m)) {
    1195     CoinPresolveAction::throwCoinError("Matrix not gap free",
    1196                                       "CoinPostsolveMatrix");
    1197   }
    1198 
    1199   const CoinBigIndex nelemsr = m->getNumElements();
    1200 
    1201   ClpDisjointCopyN(m->getVectorStarts(), ncols1, mcstrt_);
    1202   CoinZeroN(mcstrt_+ncols1,ncols0_-ncols1);
    1203   mcstrt_[ncols1] = nelems0;    // ??    (should point to end of bulk store   -- lh --)
    1204   ClpDisjointCopyN(m->getVectorLengths(),ncols1,  hincol_);
    1205   ClpDisjointCopyN(m->getIndices(),      nelemsr, hrow_);
    1206   ClpDisjointCopyN(m->getElements(),     nelemsr, colels_);
     1196    // Odd - gaps
     1197    CoinPackedMatrix mm(*m);
     1198    mm.removeGaps();
     1199   
     1200    ClpDisjointCopyN(mm.getVectorStarts(), ncols1, mcstrt_);
     1201    CoinZeroN(mcstrt_+ncols1,ncols0_-ncols1);
     1202    mcstrt_[ncols1] = nelems0;  // ??    (should point to end of bulk store   -- lh --)
     1203    ClpDisjointCopyN(mm.getVectorLengths(),ncols1,  hincol_);
     1204    ClpDisjointCopyN(mm.getIndices(),      nelemsr, hrow_);
     1205    ClpDisjointCopyN(mm.getElements(),     nelemsr, colels_);
     1206  } else {
     1207    // No gaps
     1208   
     1209    ClpDisjointCopyN(m->getVectorStarts(), ncols1, mcstrt_);
     1210    CoinZeroN(mcstrt_+ncols1,ncols0_-ncols1);
     1211    mcstrt_[ncols1] = nelems0;  // ??    (should point to end of bulk store   -- lh --)
     1212    ClpDisjointCopyN(m->getVectorLengths(),ncols1,  hincol_);
     1213    ClpDisjointCopyN(m->getIndices(),      nelemsr, hrow_);
     1214    ClpDisjointCopyN(m->getElements(),     nelemsr, colels_);
     1215  }
     1216
    12071217
    12081218
Note: See TracChangeset for help on using the changeset viewer.