3 #ifndef CglPreProcess_H
4 #define CglPreProcess_H
9 #include "CoinFinite.hpp"
10 #include "CoinMessageHandler.hpp"
11 #include "OsiSolverInterface.hpp"
13 #include "OsiPresolve.hpp"
50 OsiSolverInterface *
preProcess(OsiSolverInterface & model,
51 bool makeEquality=
false,
int numberPasses=5);
64 int makeEquality=0,
int numberPasses=5,
82 OsiSolverInterface *
someFixed(OsiSolverInterface & model,
83 double fractionToKeep=0.25,
84 bool fixContinuousAsWell=
false,
85 char * keep=NULL)
const;
179 void update(
const OsiPresolve * pinfo,
const OsiSolverInterface * solver);
264 OsiSolverInterface *
modified(OsiSolverInterface * model,
const char * prohibited()
Updated prohibited columns.
int numberCutGenerators() const
Get the number of cut generators.
int numberRowType_
Number of rows in original row types.
void passInRowTypes(const char *rowTypes, int numberRows)
Pass in row types 0 normal 1 cut rows - will be dropped if remain in At end of preprocess cut rows wi...
char * prohibited_
Columns which should not be presolved e.g. SOS.
void createOriginalIndices() const
create original columns and rows
int * originalRow_
Original row numbers.
void passInProhibited(const char *prohibited, int numberColumns)
Pass in prohibited columns.
double * weightSOS_
Weights for each SOS column.
int * startSOS_
Start of each SOS.
int numberIterationsPre_
Number of iterations done in PreProcessing.
int numberSOS() const
Number of SOS if found.
bool defaultHandler_
Flag to say if handler_ is the default handler.
void setLanguage(CoinMessages::Language language)
Pass in Message handler (not deleted at end)
int * originalColumn_
Original column numbers.
const int * originalRows() const
Return a pointer to the original rows MUST be called before postProcess otherwise you just get 0...
Class for preProcessing and postProcessing.
void passInMessageHandler(CoinMessageHandler *handler)
Pass in Message handler (not deleted at end)
~CglPreProcess()
Destructor.
char * rowType_
Row types (may be NULL) Carried around and corresponds to existing rows -1 added by preprocess e...
CoinMessages * messagesPointer()
Return pointer to messages.
const char * rowTypes()
Updated row types - may be NULL Carried around and corresponds to existing rows -1 added by preproces...
void postProcess(OsiSolverInterface &model)
Creates solution in original model.
const int * originalColumns() const
Return a pointer to the original columns (with possible clique slacks) MUST be called before postProc...
int numberIterationsPre() const
Number of iterations PreProcessing.
CglCutGenerator * cutGenerator(int i) const
Get the specified cut generator.
CglCutGenerator ** cutGenerators() const
Get the list of cut generators.
int numberSolvers_
Number of solvers at various stages.
const int * whichSOS() const
Columns in SOS.
int numberProhibited_
Number of columns in original prohibition set.
int numberIterationsPost() const
Number of iterations PostProcessing.
void update(const OsiPresolve *pinfo, const OsiSolverInterface *solver)
Update prohibited and rowType.
OsiPresolve * presolve(int iPass) const
Matching presolve information.
OsiSolverInterface * someFixed(OsiSolverInterface &model, double fractionToKeep=0.25, bool fixContinuousAsWell=false, char *keep=NULL) const
Fix some of problem - returning new problem.
OsiSolverInterface * startModel_
Solver after making clique equalities (may == original)
OsiSolverInterface * startModel() const
Solver after making clique equalities (may == original)
OsiSolverInterface * preProcessNonDefault(OsiSolverInterface &model, int makeEquality=0, int numberPasses=5, int tuning=0)
preProcess problem - returning new problem.
int numberIterationsPost_
Number of iterations done in PostProcessing.
OsiSolverInterface * originalModel() const
The original solver associated with this model.
const int * startSOS() const
Start of each SOS.
CglPreProcess()
Constructor.
int * whichSOS_
Columns in SOS.
int numberSOS_
Number of SOS if found.
OsiSolverInterface * modified(OsiSolverInterface *model, bool constraints, int &numberChanges, int iBigPass, int numberPasses)
Return model with useful modifications.
void setCutoff(double value)
Set cutoff bound on the objective function.
void * appData_
Pointer to user-defined data structure.
void makeInteger()
Make continuous variables integer.
CglPreProcess & operator=(const CglPreProcess &rhs)
Assignment operator.
Cut Generator Base Class.
CoinMessageHandler * messageHandler() const
Return handler.
void gutsOfDestructor()
Clears out as much as possible.
int options_
Options 1 - original model had integer bounds before tightening.
CglStored cuts_
Cuts from dropped rows.
int * typeSOS_
Type of each SOS.
const CglStored * cutsPointer() const
Return pointer to cuts from dropped rows.
void * getApplicationData() const
Get application data.
OsiSolverInterface * modifiedModel(int iPass) const
Copies of solver at various stages after presolve after modifications.
OsiPresolve ** presolve_
Matching presolve information.
void newLanguage(CoinMessages::Language language)
Set language.
int reducedCostFix(OsiSolverInterface &model)
If we have a cutoff - fix variables.
const CglStored & cuts() const
Return cuts from dropped rows.
void setApplicationData(void *appData)
Set application data.
int tightenPrimalBounds(OsiSolverInterface &model, double factor=0.0)
Tightens primal bounds to make dual and branch and cutfaster.
CoinMessages messages()
Return messages.
Stored Cut Generator Class.
OsiSolverInterface * preProcess(OsiSolverInterface &model, bool makeEquality=false, int numberPasses=5)
preProcess problem - returning new problem.
CoinMessageHandler * handler_
Message handler.
OsiSolverInterface ** modifiedModel_
Copies of solver at various stages after presolve after modifications.
CoinMessages messages_
Cgl messages.
void addCutGenerator(CglCutGenerator *generator)
Add one generator - up to user to delete generators.
CglCutGenerator ** generator_
Cut generators.
const int * typeSOS() const
Type of each SOS.
const double * weightSOS() const
Weights for each SOS column.
OsiSolverInterface * originalModel_
The original solver associated with this model.
void setOptions(int value)
Set options.
OsiSolverInterface ** model_
Copies of solver at various stages after presolve.
int numberCutGenerators_
Number of cut generators.
double getCutoff() const
Get the cutoff bound on the objective function - always as minimize.
OsiSolverInterface * modelAtPass(int iPass) const
Copies of solver at various stages after presolve.