00001 // Copyright (C) 2003, International Business Machines 00002 // Corporation and others. All Rights Reserved. 00003 00004 #ifndef OsiPresolve_H 00005 #define OsiPresolve_H 00006 #include "OsiSolverInterface.hpp" 00007 00008 class CoinPresolveAction; 00009 #include "CoinPresolveMatrix.hpp" 00010 00011 00061 class OsiPresolve { 00062 public: 00064 OsiPresolve(); 00065 00067 virtual ~OsiPresolve(); 00068 00088 virtual OsiSolverInterface *presolvedModel(OsiSolverInterface & origModel, 00089 double feasibilityTolerance=0.0, 00090 bool keepIntegers=true, 00091 int numberPasses=5, 00092 const char * prohibited=NULL); 00093 00111 virtual void postsolve(bool updateStatus=true); 00112 00114 OsiSolverInterface * model() const; 00115 00117 OsiSolverInterface * originalModel() const; 00118 00120 void setOriginalModel(OsiSolverInterface *model); 00121 00123 const int * originalColumns() const; 00124 00126 const int * originalRows() const; 00127 00132 inline void setNonLinearValue(double value) 00133 { nonLinearValue_ = value;}; 00134 inline double nonLinearValue() const 00135 { return nonLinearValue_;}; 00143 inline void setPresolveActions(int action) 00144 { presolveActions_ = (presolveActions_&0xffff0000)|(action&0xffff);}; 00145 00146 private: 00151 OsiSolverInterface * originalModel_; 00152 00157 OsiSolverInterface * presolvedModel_; 00158 00164 double nonLinearValue_; 00165 00167 int * originalColumn_; 00168 00170 int * originalRow_; 00171 00173 const CoinPresolveAction *paction_; 00174 00181 int ncols_; 00182 00184 int nrows_; 00185 00187 CoinBigIndex nelems_; 00188 00194 int presolveActions_; 00196 int numberPasses_; 00197 00198 protected: 00207 virtual const CoinPresolveAction *presolve(CoinPresolveMatrix *prob); 00208 00219 virtual void postsolve(CoinPostsolveMatrix &prob); 00220 00227 void gutsOfDestroy(); 00228 }; 00229 #endif