- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

OsiPresolve.hpp
Go to the documentation of this file.
1 // Copyright (C) 2003, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 // This code is licensed under the terms of the Eclipse Public License (EPL).
4
5 #ifndef OsiPresolve_H
6 #define OsiPresolve_H
7 #include "OsiSolverInterface.hpp"
8
9 class CoinPresolveAction;
10 #include "CoinPresolveMatrix.hpp"
11
12
62 class OsiPresolve {
63 public:
65 OsiPresolve();
66
68 virtual ~OsiPresolve();
69
90 virtual OsiSolverInterface *presolvedModel(OsiSolverInterface & origModel,
91 double feasibilityTolerance=0.0,
92 bool keepIntegers=true,
93 int numberPasses=5,
94 const char * prohibited=NULL,
95 bool doStatus=true,
96 const char * rowProhibited=NULL);
97
115 virtual void postsolve(bool updateStatus=true);
116
118 OsiSolverInterface * model() const;
119
121 OsiSolverInterface * originalModel() const;
122
124 void setOriginalModel(OsiSolverInterface *model);
125
127 const int * originalColumns() const;
128
130 const int * originalRows() const;
131
133 inline int getNumRows() const
134 { return nrows_;}
135
137 inline int getNumCols() const
138 { return ncols_;}
139
144 inline void setNonLinearValue(double value)
145 { nonLinearValue_ = value;}
146 inline double nonLinearValue() const
147 { return nonLinearValue_;}
166 inline void setPresolveActions(int action)
167 { presolveActions_ = (presolveActions_&0xffff0000)|(action&0xffff);}
168
169 private:
174 OsiSolverInterface * originalModel_;
175
180 OsiSolverInterface * presolvedModel_;
181
187 double nonLinearValue_;
188
190 int * originalColumn_;
191
193 int * originalRow_;
194
196 const CoinPresolveAction *paction_;
197
204 int ncols_;
205
207 int nrows_;
208
210 CoinBigIndex nelems_;
211
217 int presolveActions_;
219 int numberPasses_;
220
221 protected:
230 virtual const CoinPresolveAction *presolve(CoinPresolveMatrix *prob);
231
242 virtual void postsolve(CoinPostsolveMatrix &prob);
243
250 void gutsOfDestroy();
251 };
252 #endif
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:105
OsiPresolve::~OsiPresolve
virtual ~OsiPresolve()
Virtual destructor.
OsiPresolve::presolvedModel_
OsiSolverInterface * presolvedModel_
Definition: OsiPresolve.hpp:180
OsiPresolve::getNumCols
int getNumCols() const
Return number of columns in original model.
Definition: OsiPresolve.hpp:137
OsiPresolve::presolve
virtual const CoinPresolveAction * presolve(CoinPresolveMatrix *prob)
Apply presolve transformations to the problem.
OsiPresolve::originalModel_
OsiSolverInterface * originalModel_
Definition: OsiPresolve.hpp:174
OsiPresolve::model
OsiSolverInterface * model() const
Return a pointer to the presolved model.
OsiPresolve::getNumRows
int getNumRows() const
Return number of rows in original model.
Definition: OsiPresolve.hpp:133
CoinPostsolveMatrix
Augments CoinPrePostsolveMatrix with information about the problem that is only needed during postsol...
Definition: CoinPresolveMatrix.hpp:1421
OsiPresolve::paction_
const CoinPresolveAction * paction_
The list of transformations applied.
Definition: OsiPresolve.hpp:196
CoinPresolveMatrix
Augments CoinPrePostsolveMatrix with information about the problem that is only needed during presolv...
Definition: CoinPresolveMatrix.hpp:835
OsiPresolve::OsiPresolve
OsiPresolve()
Default constructor (empty object)
OsiPresolve::presolveActions_
int presolveActions_
Whether we want to skip dual part of presolve etc.
Definition: OsiPresolve.hpp:217
OsiPresolve::setPresolveActions
void setPresolveActions(int action)
Fine control over presolve actions.
Definition: OsiPresolve.hpp:166
OsiPresolve::setOriginalModel
void setOriginalModel(OsiSolverInterface *model)
Set the pointer to the original model.
OsiPresolve::originalColumn_
int * originalColumn_
Original column numbers.
Definition: OsiPresolve.hpp:190
OsiPresolve::originalColumns
const int * originalColumns() const
Return a pointer to the original columns.
OsiPresolve::numberPasses_
int numberPasses_
Number of major passes.
Definition: OsiPresolve.hpp:219
OsiPresolve::presolvedModel
virtual OsiSolverInterface * presolvedModel(OsiSolverInterface &origModel, double feasibilityTolerance=0.0, bool keepIntegers=true, int numberPasses=5, const char *prohibited=NULL, bool doStatus=true, const char *rowProhibited=NULL)
Create a new OsiSolverInterface loaded with the presolved problem.
OsiPresolve::originalModel
OsiSolverInterface * originalModel() const
Return a pointer to the original model.
OsiPresolve::originalRows
const int * originalRows() const
Return a pointer to the original rows.
OsiPresolve::gutsOfDestroy
void gutsOfDestroy()
Destroys queued postsolve actions.
OsiPresolve
OSI interface to COIN problem simplification capabilities.
Definition: OsiPresolve.hpp:62
OsiPresolve::nrows_
int nrows_
Number of rows in original model.
Definition: OsiPresolve.hpp:207
CoinPresolveAction
Abstract base class of all presolve routines.
Definition: CoinPresolveMatrix.hpp:155
OsiSolverInterface.hpp
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:62
CoinPresolveMatrix.hpp
OsiPresolve::postsolve
virtual void postsolve(bool updateStatus=true)
Restate the solution to the presolved problem in terms of the original problem and load it into the o...
OsiPresolve::ncols_
int ncols_
Number of columns in original model.
Definition: OsiPresolve.hpp:204
OsiPresolve::nonLinearValue_
double nonLinearValue_
Definition: OsiPresolve.hpp:187
OsiPresolve::originalRow_
int * originalRow_
Original row numbers.
Definition: OsiPresolve.hpp:193
OsiPresolve::setNonLinearValue
void setNonLinearValue(double value)
&quot;Magic&quot; number.
Definition: OsiPresolve.hpp:144
OsiPresolve::nelems_
CoinBigIndex nelems_
Number of nonzero matrix coefficients in the original model.
Definition: OsiPresolve.hpp:210
OsiPresolve::nonLinearValue
double nonLinearValue() const
Definition: OsiPresolve.hpp:146