Changeset 450 for trunk/ClpPresolve.cpp


Ignore:
Timestamp:
Sep 17, 2004 1:48:49 PM (15 years ago)
Author:
forrest
Message:

For Lou's changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpPresolve.cpp

    r446 r450  
    130130ClpPresolve::postsolve(bool updateStatus)
    131131{
     132  // Return at once if no presolved model
     133  if (!presolvedModel_)
     134    return;
    132135  // Messages
    133136  CoinMessages messages = CoinMessage(presolvedModel_->messages().language());
     
    855858                                             int ncols_in,
    856859                                             int nrows_in,
    857                                              CoinBigIndex nelems_in) :
    858   ncols_(si->getNumCols()),
    859   ncols0_(ncols_in),
    860   nrows0_(nrows_in),
    861   nelems_(si->getNumElements()),
    862 
    863   handler_(0),
    864   defaultHandler_(false),
    865   messages_(),
    866 
    867   mcstrt_(new CoinBigIndex[ncols_in+1]),
    868   hincol_(new int[ncols_in+1]),
    869   hrow_  (new int   [2*nelems_in]),
    870   colels_(new double[2*nelems_in]),
    871 
    872   cost_(new double[ncols_in]),
    873   clo_(new double[ncols_in]),
    874   cup_(new double[ncols_in]),
    875   rlo_(new double[nrows_in]),
    876   rup_(new double[nrows_in]),
    877   originalColumn_(new int[ncols_in]),
    878   originalRow_(new int[nrows_in]),
    879 
    880   ztolzb_(getTolerance(si, ClpPrimalTolerance)),
    881   ztoldj_(getTolerance(si, ClpDualTolerance)),
    882 
    883   maxmin_(si->getObjSense())
     860                                             CoinBigIndex nelems_in)
     861  : ncols_(si->getNumCols()),
     862    nrows_(si->getNumRows()),
     863    nelems_(si->getNumElements()),
     864    ncols0_(ncols_in),
     865    nrows0_(nrows_in),
     866    mcstrt_(new CoinBigIndex[ncols_in+1]),
     867    hincol_(new int[ncols_in+1]),
     868    hrow_  (new int   [2*nelems_in]),
     869    colels_(new double[2*nelems_in]),
     870    cost_(new double[ncols_in]),
     871    clo_(new double[ncols_in]),
     872    cup_(new double[ncols_in]),
     873    rlo_(new double[nrows_in]),
     874    rup_(new double[nrows_in]),
     875    originalColumn_(new int[ncols_in]),
     876    originalRow_(new int[nrows_in]),
     877    ztolzb_(getTolerance(si, ClpPrimalTolerance)),
     878    ztoldj_(getTolerance(si, ClpDualTolerance)),
     879    maxmin_(si->getObjSense()),
     880    sol_(NULL),
     881    rowduals_(NULL),
     882    acts_(NULL),
     883    rcosts_(NULL),
     884    colstat_(NULL),
     885    rowstat_(NULL),
     886    handler_(NULL),
     887    defaultHandler_(false),
     888    messages_()
    884889
    885890{
     
    964969  feasibilityTolerance_(0.0),
    965970  status_(-1),
     971  colsToDo_(new int [ncols0_in]),
     972  numberColsToDo_(0),
     973  nextColsToDo_(new int[ncols0_in]),
     974  numberNextColsToDo_(0),
    966975  rowsToDo_(new int [nrows_in]),
    967976  numberRowsToDo_(0),
    968977  nextRowsToDo_(new int[nrows_in]),
    969   numberNextRowsToDo_(0),
    970   colsToDo_(new int [ncols0_in]),
    971   numberColsToDo_(0),
    972   nextColsToDo_(new int[ncols0_in]),
    973   numberNextColsToDo_(0)
     978  numberNextRowsToDo_(0)
    974979
    975980{
     
    12961301  originalRow_ = new int[nrows_];
    12971302
    1298   // result is 0 - okay, 1 infeasible, -1 go round again
     1303  // result is 0 - okay, 1 infeasible, -1 go round again, 2 - original model
    12991304  int result = -1;
    13001305 
     
    15311536        }
    15321537      }
     1538    } else if (prob.status_) {
     1539      // infeasible or unbounded
     1540      result=1;
    15331541    } else {
    1534       // infeasible
    1535       delete [] prob.sol_;
    1536       delete [] prob.acts_;
    1537       delete [] prob.colstat_;
    1538       result=1;
    1539     }
    1540   }
    1541   if (!result) {
     1542      // no changes - model needs restoring after Lou's changes
     1543      if (saveFile_=="") {
     1544        delete presolvedModel_;
     1545        presolvedModel_ = new ClpSimplex(*originalModel);
     1546      } else {
     1547        presolvedModel_=originalModel;
     1548      }
     1549      presolvedModel_->dropNames();
     1550     
     1551      // drop integer information if wanted
     1552      if (!keepIntegers)
     1553        presolvedModel_->deleteIntegerInformation();
     1554      result=2;
     1555    }
     1556  }
     1557  if (result==0||result==2) {
    15421558    int nrowsAfter = presolvedModel_->getNumRows();
    15431559    int ncolsAfter = presolvedModel_->getNumCols();
Note: See TracChangeset for help on using the changeset viewer.