00001
00002
00003
00004 #ifndef ClpPresolve_H
00005 #define ClpPresolve_H
00006 #include "ClpSimplex.hpp"
00007
00008 class CoinPresolveAction;
00009 #include "CoinPresolveMatrix.hpp"
00010 class ClpPresolve {
00011 public:
00013 ClpPresolve();
00014
00016 virtual ~ClpPresolve();
00018
00034 ClpSimplex * presolvedModel(ClpSimplex & si,
00035 double feasibilityTolerance=0.0,
00036 bool keepIntegers=true,
00037 int numberPasses=5,
00038 bool dropNames=false);
00042 int presolvedModelToFile(ClpSimplex &si,std::string fileName,
00043 double feasibilityTolerance=0.0,
00044 bool keepIntegers=true,
00045 int numberPasses=5);
00048 ClpSimplex * model() const;
00050 ClpSimplex * originalModel() const;
00052 void setOriginalModel(ClpSimplex * model);
00053
00055 const int * originalColumns() const;
00057 const int * originalRows() const;
00062 inline void setNonLinearValue(double value)
00063 { nonLinearValue_ = value;};
00064 inline double nonLinearValue() const
00065 { return nonLinearValue_;};
00066
00075 virtual void postsolve(bool updateStatus=true);
00076
00078 void destroyPresolve();
00079
00081 private:
00083 ClpSimplex * originalModel_;
00084
00086 ClpSimplex * presolvedModel_;
00092 double nonLinearValue_;
00094 int * originalColumn_;
00096 int * originalRow_;
00098 const CoinPresolveAction *paction_;
00099
00105 int ncols_;
00106 int nrows_;
00107 CoinBigIndex nelems_;
00109 int numberPasses_;
00111 std::string saveFile_;
00112
00113 protected:
00117 virtual const CoinPresolveAction *presolve(CoinPresolveMatrix *prob);
00118
00124 virtual void postsolve(CoinPostsolveMatrix &prob);
00126 virtual ClpSimplex * gutsOfPresolvedModel(ClpSimplex * originalModel
00127 ,double feasibilityTolerance,
00128 bool keepIntegers,
00129 int numberPasses,
00130 bool dropNames);
00131 };
00132 #endif