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 
10 #include "CoinPresolveMatrix.hpp"
11 
12 
62 class OsiPresolve {
63 public:
65  OsiPresolve();
66 
68  virtual ~OsiPresolve();
69 
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 
122 
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:
175 
181 
188 
191 
194 
197 
204  int ncols_;
205 
207  int nrows_;
208 
211 
220 
221 protected:
230  virtual const CoinPresolveAction *presolve(CoinPresolveMatrix *prob);
231 
242  virtual void postsolve(CoinPostsolveMatrix &prob);
243 
250  void gutsOfDestroy();
251 };
252 #endif
int CoinBigIndex
virtual ~OsiPresolve()
Virtual destructor.
OsiSolverInterface * presolvedModel_
int getNumCols() const
Return number of columns in original model.
virtual const CoinPresolveAction * presolve(CoinPresolveMatrix *prob)
Apply presolve transformations to the problem.
OsiSolverInterface * originalModel_
OsiSolverInterface * model() const
Return a pointer to the presolved model.
int getNumRows() const
Return number of rows in original model.
Augments CoinPrePostsolveMatrix with information about the problem that is only needed during postsol...
const CoinPresolveAction * paction_
The list of transformations applied.
Augments CoinPrePostsolveMatrix with information about the problem that is only needed during presolv...
OsiPresolve()
Default constructor (empty object)
int presolveActions_
Whether we want to skip dual part of presolve etc.
void setPresolveActions(int action)
Fine control over presolve actions.
void setOriginalModel(OsiSolverInterface *model)
Set the pointer to the original model.
int * originalColumn_
Original column numbers.
const int * originalColumns() const
Return a pointer to the original columns.
int numberPasses_
Number of major passes.
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.
OsiSolverInterface * originalModel() const
Return a pointer to the original model.
const int * originalRows() const
Return a pointer to the original rows.
void gutsOfDestroy()
Destroys queued postsolve actions.
OSI interface to COIN problem simplification capabilities.
Definition: OsiPresolve.hpp:62
int nrows_
Number of rows in original model.
Abstract base class of all presolve routines.
Abstract Base Class for describing an interface to a solver.
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...
int ncols_
Number of columns in original model.
double nonLinearValue_
int * originalRow_
Original row numbers.
void setNonLinearValue(double value)
"Magic" number.
CoinBigIndex nelems_
Number of nonzero matrix coefficients in the original model.
double nonLinearValue() const