Changeset 1635 for trunk/Clp


Ignore:
Timestamp:
Nov 24, 2010 5:46:22 AM (9 years ago)
Author:
forrest
Message:

fix bug when presolved model infeasible but original feasible.
also allow names in presolve to file.

Location:
trunk/Clp/src
Files:
2 edited

Legend:

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

    r1596 r1635  
    114114                                  bool keepIntegers,
    115115                                  int numberPasses,
     116                                  bool dropNames,
    116117                                  bool doRowObjective)
    117118{
     
    122123     saveFile_ = fileName;
    123124     si.saveModel(saveFile_.c_str());
    124      ClpSimplex * model = gutsOfPresolvedModel(&si, feasibilityTolerance, keepIntegers, numberPasses, true,
     125     ClpSimplex * model = gutsOfPresolvedModel(&si, feasibilityTolerance, keepIntegers, numberPasses, dropNames,
    125126                          doRowObjective);
    126127     if (model == &si) {
     
    305306     } else {
    306307          originalModel_->setProblemStatus( presolvedModel_->status());
     308          // but not if close to feasible
     309          if( originalModel_->sumPrimalInfeasibilities()<1.0e-1) {
     310               originalModel_->setProblemStatus( -1);
     311               // Say not optimal after presolve
     312               originalModel_->setSecondaryStatus(7);
     313          }
    307314     }
    308315#ifndef CLP_NO_STD
     
    15231530#ifndef CLP_NO_STD
    15241531               originalModel->setLengthNames(lengthNames);
     1532               presolvedModel_->dropNames();
    15251533          } else {
    15261534               presolvedModel_ = originalModel;
    1527           }
    1528           presolvedModel_->dropNames();
     1535               if (dropNames)
     1536                 presolvedModel_->dropNames();
     1537          }
    15291538#endif
    15301539
  • trunk/Clp/src/ClpPresolve.hpp

    r1525 r1635  
    4646#ifndef CLP_NO_STD
    4747     /** This version saves data in a file.  The passed in model
    48          is updated to be presolved model.  names are always dropped.
     48         is updated to be presolved model. 
    4949         Returns non-zero if infeasible*/
    5050     int presolvedModelToFile(ClpSimplex &si, std::string fileName,
     
    5252                              bool keepIntegers = true,
    5353                              int numberPasses = 5,
     54                              bool dropNames = false,
    5455                              bool doRowObjective = false);
    5556#endif
Note: See TracChangeset for help on using the changeset viewer.