Osi 0.108.9
Loading...
Searching...
No Matches
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
8
9class CoinPresolveAction;
10#include "CoinPresolveMatrix.hpp"
11
60public:
63
65 virtual ~OsiPresolve();
66
88 double feasibilityTolerance = 0.0,
89 bool keepIntegers = true,
90 int numberPasses = 5,
91 const char *prohibited = NULL,
92 bool doStatus = true,
93 const char *rowProhibited = NULL);
94
112 virtual void postsolve(bool updateStatus = true);
113
116
119
122
124 const int *originalColumns() const;
125
127 const int *originalRows() const;
128
130 inline int getNumRows() const
131 {
132 return nrows_;
133 }
134
136 inline int getNumCols() const
137 {
138 return ncols_;
139 }
140
145 inline void setNonLinearValue(double value)
146 {
147 nonLinearValue_ = value;
148 }
149 inline double nonLinearValue() const
150 {
151 return nonLinearValue_;
152 }
171 inline void setPresolveActions(int action)
172 {
173 presolveActions_ = (presolveActions_ & 0xffff0000) | (action & 0xffff);
174 }
177 {
178 return presolvedModel_;
179 }
185
186private:
192
198
205
208
211
213 const CoinPresolveAction *paction_;
214
222
225
227 CoinBigIndex nelems_;
228
237
238protected:
247 virtual const CoinPresolveAction *presolve(CoinPresolveMatrix *prob);
248
259 virtual void postsolve(CoinPostsolveMatrix &prob);
260
268};
269#endif
270
271/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
272*/
OSI interface to COIN problem simplification capabilities.
int * originalColumn_
Original column numbers.
void setNonLinearValue(double value)
"Magic" number.
OsiPresolve()
Default constructor (empty object)
void gutsOfDestroy()
Destroys queued postsolve actions.
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...
OsiSolverInterface * originalModel_
Original model (solver interface loaded with the original problem).
virtual ~OsiPresolve()
Virtual destructor.
int presolveActions_
Whether we want to skip dual part of presolve etc.
CoinBigIndex nelems_
Number of nonzero matrix coefficients in the original model.
void setPresolveActions(int action)
Fine control over presolve actions.
OsiSolverInterface * presolvedModel_
Presolved model (solver interface loaded with the presolved problem)
int * originalRow_
Original row numbers.
int ncols_
Number of columns in original model.
const int * originalRows() const
Return a pointer to the original rows.
double nonLinearValue() const
OsiSolverInterface * originalModel() const
Return a pointer to the original model.
OsiSolverInterface * model() const
Return a pointer to the presolved model.
double nonLinearValue_
"Magic" number.
int nrows_
Number of rows in original model.
OsiSolverInterface * presolvedModel() const
Get presolved model.
int getNumRows() const
Return number of rows in original model.
virtual void postsolve(CoinPostsolveMatrix &prob)
Reverse presolve transformations to recover the solution to the original problem.
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.
int numberPasses_
Number of major passes.
virtual const CoinPresolveAction * presolve(CoinPresolveMatrix *prob)
Apply presolve transformations to the problem.
const int * originalColumns() const
Return a pointer to the original columns.
int getNumCols() const
Return number of columns in original model.
const CoinPresolveAction * paction_
The list of transformations applied.
void setPresolvedModel(OsiSolverInterface *presolvedModel)
Set presolved model.
void setOriginalModel(OsiSolverInterface *model)
Set the pointer to the original model.
Abstract Base Class for describing an interface to a solver.