Changeset 1699 for trunk


Ignore:
Timestamp:
Mar 8, 2011 5:49:01 AM (9 years ago)
Author:
forrest
Message:

allow to distinguish between infeasible and unbounded in presolve

Location:
trunk/Clp/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpPresolve.cpp

    r1665 r1699  
    147147{
    148148     return originalModel_;
     149}
     150// Return presolve status (0,1,2)
     151int
     152ClpPresolve::presolveStatus() const
     153{
     154  if (nelems_>=0) {
     155    // feasible (or not done yet)
     156    return 0;
     157  } else {
     158    int presolveStatus = - nelems_;
     159    // If both infeasible and unbounded - say infeasible
     160    if (presolveStatus>2)
     161      presolveStatus = 1;
     162    return presolveStatus;
     163  }
    149164}
    150165void
     
    18541869               // infeasible or unbounded
    18551870               result = 1;
     1871               // Put status in nelems_!
     1872               nelems_ = - prob.status_;
    18561873               originalModel->setProblemStatus(prob.status_);
    18571874          } else {
  • trunk/Clp/src/ClpPresolve.hpp

    r1665 r1699  
    181181          presolveActions_ |= 0x80000000;
    182182     }
     183     /// Return presolve status (0,1,2)
     184     int presolveStatus() const;
    183185
    184186     /**@name postsolve - postsolve the problem.  If the problem
  • trunk/Clp/src/ClpSolve.cpp

    r1694 r1699  
    494494               model2 = this;
    495495               eventHandler()->event(ClpEventHandler::presolveInfeasible);
    496                problemStatus_ = 1; // may be unbounded but who cares
     496               problemStatus_ = pinfo->presolveStatus();
    497497               if (options.infeasibleReturn() || (moreSpecialOptions_ & 1) != 0) {
    498498                 delete pinfo;
Note: See TracChangeset for help on using the changeset viewer.