10 class CoinPresolveAction;
11 #include "CoinPresolveMatrix.hpp"
42 double feasibilityTolerance = 0.0,
43 bool keepIntegers =
true,
45 bool dropNames =
false,
46 bool doRowObjective =
false,
47 const char * prohibitedRows=NULL,
48 const char * prohibitedColumns=NULL);
54 double feasibilityTolerance = 0.0,
55 bool keepIntegers =
true,
57 bool dropNames =
false,
58 bool doRowObjective =
false);
77 nonLinearValue_ = value;
80 return nonLinearValue_;
84 return (presolveActions_ & 1) == 0;
87 if (doDual) presolveActions_ &= ~1;
88 else presolveActions_ |= 1;
92 return (presolveActions_ & 2) == 0;
95 if (doSingleton) presolveActions_ &= ~2;
96 else presolveActions_ |= 2;
100 return (presolveActions_ & 4) == 0;
103 if (doDoubleton) presolveActions_ &= ~4;
104 else presolveActions_ |= 4;
108 return (presolveActions_ & 8) == 0;
111 if (doTripleton) presolveActions_ &= ~8;
112 else presolveActions_ |= 8;
116 return (presolveActions_ & 16) == 0;
119 if (doTighten) presolveActions_ &= ~16;
120 else presolveActions_ |= 16;
124 return (presolveActions_ & 32) == 0;
127 if (doForcing) presolveActions_ &= ~32;
128 else presolveActions_ |= 32;
132 return (presolveActions_ & 64) == 0;
135 if (doImpliedfree) presolveActions_ &= ~64;
136 else presolveActions_ |= 64;
140 return (presolveActions_ & 128) == 0;
143 if (doDupcol) presolveActions_ &= ~128;
144 else presolveActions_ |= 128;
148 return (presolveActions_ & 256) == 0;
151 if (doDuprow) presolveActions_ &= ~256;
152 else presolveActions_ |= 256;
156 return (presolveActions_ & 32768) != 0;
159 if (doDependency) presolveActions_ |= 32768;
160 else presolveActions_ &= ~32768;
164 return (presolveActions_ & 512) == 0;
167 if (doSingleton) presolveActions_ &= ~512;
168 else presolveActions_ |= 512;
172 return (presolveActions_ & 1024) == 0;
175 if (doGubrow) presolveActions_ &= ~1024;
176 else presolveActions_ |= 1024;
180 return (presolveActions_ & 2048) != 0;
183 if (!doTwoxTwo) presolveActions_ &= ~2048;
184 else presolveActions_ |= 2048;
188 return (presolveActions_ & 4096) != 0;
191 if (doIntersection) presolveActions_ &= ~4096;
192 else presolveActions_ |= 4096;
197 return (presolveActions_&(8192|16384))>>13;
200 presolveActions_ &= ~(8192|16384);
201 presolveActions_ |= value<<13;
205 return presolveActions_ & 0xffff;
208 presolveActions_ = (presolveActions_ & 0xffff0000) | (action & 0xffff);
212 substitution_ = value;
216 presolveActions_ |= 0x80000000;
229 virtual void postsolve(
bool updateStatus =
true);
246 double nonLinearValue_;
248 int * originalColumn_;
252 double * rowObjective_;
254 const CoinPresolveAction *paction_;
263 CoinBigIndex nelems_;
269 std::string saveFile_;
276 int presolveActions_;
281 virtual const CoinPresolveAction *
presolve(CoinPresolveMatrix *prob);
288 virtual void postsolve(CoinPostsolveMatrix &prob);
291 double feasibilityTolerance,
296 const char * prohibitedRows=NULL,
297 const char * prohibitedColumns=NULL);
ClpSimplex * originalModel() const
Return pointer to original model.
double nonLinearValue() const
bool doSingletonColumn() const
Whether we want to do singleton column part of presolve.
void setDoTighten(bool doTighten)
void setDoIntersection(bool doIntersection)
bool doTighten() const
Whether we want to do tighten part of presolve.
void setDoDual(bool doDual)
int presolveActions() const
Set whole group.
void setDoTripleton(bool doTripleton)
void setDoDuprow(bool doDuprow)
bool doSingleton() const
Whether we want to do singleton part of presolve.
bool doDependency() const
Whether we want to do dependency part of presolve.
bool doDuprow() const
Whether we want to do duprow part of presolve.
bool doDual() const
Whether we want to do dual part of presolve.
void setDoImpliedFree(bool doImpliedfree)
ClpSimplex * presolvedModel(ClpSimplex &si, double feasibilityTolerance=0.0, bool keepIntegers=true, int numberPasses=5, bool dropNames=false, bool doRowObjective=false, const char *prohibitedRows=NULL, const char *prohibitedColumns=NULL)
bool doTripleton() const
Whether we want to do tripleton part of presolve.
ClpPresolve()
Default constructor.
void setSubstitution(int value)
Substitution level.
void setDoSingleton(bool doSingleton)
bool doGubrow() const
Whether we want to do gubrow part of presolve.
const int * originalRows() const
return pointer to original rows
bool doForcing() const
Whether we want to do forcing part of presolve.
void setDoDoubleton(bool doDoubleton)
void setDoForcing(bool doForcing)
void setDoTwoxtwo(bool doTwoxTwo)
virtual ClpSimplex * gutsOfPresolvedModel(ClpSimplex *originalModel, double feasibilityTolerance, bool keepIntegers, int numberPasses, bool dropNames, bool doRowObjective, const char *prohibitedRows=NULL, const char *prohibitedColumns=NULL)
This is main part of Presolve.
virtual void postsolve(bool updateStatus=true)
virtual ~ClpPresolve()
Virtual destructor.
This solves LPs using the simplex method.
void setPresolveActions(int action)
int zeroSmall() const
How much we want to zero small values from aggregation - ratio 0 - 1.0e-12, 1 1.0e-11, 2 1.0e-10, 3 1.0e-9.
bool doTwoxTwo() const
Whether we want to do twoxtwo part of presolve.
This is the Clp interface to CoinPresolve.
bool doIntersection() const
Whether we want to allow duplicate intersections.
bool doDupcol() const
Whether we want to do dupcol part of presolve.
const int * originalColumns() const
return pointer to original columns
void setDoDependency(bool doDependency)
void setDoGubrow(bool doGubrow)
void setZeroSmall(int value)
int presolvedModelToFile(ClpSimplex &si, std::string fileName, double feasibilityTolerance=0.0, bool keepIntegers=true, int numberPasses=5, bool dropNames=false, bool doRowObjective=false)
This version saves data in a file.
void setOriginalModel(ClpSimplex *model)
Set pointer to original model.
bool doImpliedFree() const
Whether we want to do impliedfree part of presolve.
ClpSimplex * model() const
Return pointer to presolved model, Up to user to destroy.
void setDoSingletonColumn(bool doSingleton)
bool doDoubleton() const
Whether we want to do doubleton part of presolve.
virtual const CoinPresolveAction * presolve(CoinPresolveMatrix *prob)
If you want to apply the individual presolve routines differently, or perhaps add your own to the mix...
int presolveStatus() const
Return presolve status (0,1,2)
void destroyPresolve()
Gets rid of presolve actions (e.g.when infeasible)
void statistics()
Asks for statistics.
void setNonLinearValue(double value)
"Magic" number.
void setDoDupcol(bool doDupcol)