Go to the documentation of this file.
5 #ifndef CglPreProcess_H
6 #define CglPreProcess_H
11 #include "CoinMessageHandler.hpp"
12 #include "OsiSolverInterface.hpp"
14 #include "OsiPresolve.hpp"
51 OsiSolverInterface *
preProcess(OsiSolverInterface & model,
52 bool makeEquality=
false,
int numberPasses=5);
65 int makeEquality=0,
int numberPasses=5,
69 ,
bool deleteStuff=
true);
84 OsiSolverInterface *
someFixed(OsiSolverInterface & model,
85 double fractionToKeep=0.25,
86 bool fixContinuousAsWell=
false,
87 char * keep=NULL)
const;
92 OsiSolverInterface *
cliqueIt(OsiSolverInterface & model,
93 double cliquesNeeded=0.0)
const;
120 {
return originalModel_;}
123 {
return startModel_;}
126 {
if (iPass>=0&&iPass<numberSolvers_)
return model_[iPass];
else return NULL;}
129 {
if (iPass>=0&&iPass<numberSolvers_)
return modifiedModel_[iPass];
else return NULL;}
132 {
if (iPass>=0&&iPass<numberSolvers_)
return presolve_[iPass];
else return NULL;}
141 {
return numberSOS_;}
153 {
return weightSOS_;}
158 {
return prohibited_;}
161 {
return numberIterationsPre_;}
164 {
return numberIterationsPost_;}
187 void update(
const OsiPresolve * pinfo,
const OsiSolverInterface * solver);
197 {
return numberCutGenerators_;}
200 {
return generator_;}
203 {
return generator_[i];}
272 OsiSolverInterface * modified(OsiSolverInterface * model,
278 void createOriginalIndices();
290 OsiSolverInterface * originalModel_;
292 OsiSolverInterface * startModel_;
296 OsiSolverInterface ** model_;
298 OsiSolverInterface ** modifiedModel_;
300 OsiPresolve ** presolve_;
303 CoinMessageHandler * handler_;
310 bool defaultHandler_;
313 CoinMessages messages_;
318 int * originalColumn_;
322 int numberCutGenerators_;
336 int numberProhibited_;
338 int numberIterationsPre_;
340 int numberIterationsPost_;
375 OsiSolverInterface *
newSolver(
const OsiSolverInterface & model);
400 CglBK(
const OsiSolverInterface & model,
const char * rowType,
432 CoinPackedMatrix * cliqueMatrix_;
434 const char * rowType_;
442 int numberCandidates_;
467 inline OsiRowCut *
cut(
int sequence)
const
468 {
return rowCut_[sequence];}
470 {
return numberCuts_;}
472 {
return numberCuts_;}
474 {
return rowCut_[sequence];}
484 OsiRowCut ** rowCut_;
const double * weightSOS() const
Weights for each SOS column.
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...
void passInMessageHandler(CoinMessageHandler *handler)
Pass in Message handler (not deleted at end)
int insertIfNotDuplicate(const OsiRowCut &cut)
CglCutGenerator ** cutGenerators() const
Get the list of cut generators.
int numberCutGenerators() const
Get the number of cut generators.
void update(const OsiPresolve *pinfo, const OsiSolverInterface *solver)
Update prohibited and rowType.
const int * originalColumns()
Return a pointer to the original columns (with possible clique slacks) MUST be called before postProc...
void newLanguage(CoinMessages::Language language)
Set language.
CglBK & operator=(const CglBK &rhs)
Assignment operator.
void setLanguage(CoinMessages::Language language)
CoinMessages * messagesPointer()
Return pointer to messages.
void setCutoff(double value)
Set cutoff bound on the objective function.
CglBK(const OsiSolverInterface &model, const char *rowType, int numberElements)
Useful constructor.
Stored Cut Generator Class.
void passInProhibited(const char *prohibited, int numberColumns)
Pass in prohibited columns.
OsiRowCut * rowCutPtr(int sequence)
const CglStored * cutsPointer() const
Return pointer to cuts from dropped rows.
CoinMessageHandler * messageHandler() const
Return handler.
const char * prohibited()
Updated prohibited columns.
OsiSolverInterface * preProcessNonDefault(OsiSolverInterface &model, int makeEquality=0, int numberPasses=5, int tuning=0)
preProcess problem - returning new problem.
Class for preProcessing and postProcessing.
CoinMessages messages()
Return messages.
CglUniqueRowCuts & operator=(const CglUniqueRowCuts &rhs)
const CglStored & cuts() const
Return cuts from dropped rows.
CglUniqueRowCuts(const CglUniqueRowCuts &rhs)
void addCuts(OsiCuts &cs)
int reducedCostFix(OsiSolverInterface &model)
If we have a cutoff - fix variables.
const int * startSOS() const
Start of each SOS.
void addCutGenerator(CglCutGenerator *generator)
Add one generator - up to user to delete generators.
Cut Generator Base Class.
int numberIterationsPost() const
Number of iterations PostProcessing.
CglBK(const CglBK &rhs)
Copy constructor .
void gutsOfDestructor()
Clears out as much as possible.
OsiSolverInterface * newSolver(const OsiSolverInterface &model)
Creates strengthened smaller model.
void eraseRowCut(int sequence)
void * getApplicationData() const
Get application data.
void bronKerbosch()
For recursive Bron-Kerbosch.
OsiSolverInterface * someFixed(OsiSolverInterface &model, double fractionToKeep=0.25, bool fixContinuousAsWell=false, char *keep=NULL) const
Fix some of problem - returning new problem.
~CglPreProcess()
Destructor.
void insert(const OsiRowCut &cut)
OsiSolverInterface * preProcess(OsiSolverInterface &model, bool makeEquality=false, int numberPasses=5)
preProcess problem - returning new problem.
double getCutoff() const
Get the cutoff bound on the objective function - always as minimize.
OsiSolverInterface * cliqueIt(OsiSolverInterface &model, double cliquesNeeded=0.0) const
Replace cliques by more maximal cliques Returns NULL if rows not reduced by greater than cliquesNeede...
OsiRowCut * cut(int sequence) const
OsiSolverInterface * modelAtPass(int iPass) const
Copies of solver at various stages after presolve.
int tightenPrimalBounds(OsiSolverInterface &model, double factor=0.0)
Tightens primal bounds to make dual and branch and cutfaster.
void setApplicationData(void *appData)
Set application data.
const int * whichSOS() const
Columns in SOS.
CglPreProcess()
Constructor.
void setOptions(int value)
Set options.
CglBK()
Default constructor.
Only store unique row cuts.
const int * typeSOS() const
Type of each SOS.
const int * originalRows()
Return a pointer to the original rows MUST be called before postProcess otherwise you just get 0,...
void postProcess(OsiSolverInterface &model, bool deleteStuff=true)
Creates solution in original model.
int numberIterationsPre() const
Number of iterations PreProcessing.
CglPreProcess(const CglPreProcess &rhs)
Copy constructor .
const char * rowTypes()
Updated row types - may be NULL Carried around and corresponds to existing rows -1 added by preproces...
CglUniqueRowCuts(int initialMaxSize=0, int hashMultiplier=4)
CglPreProcess & operator=(const CglPreProcess &rhs)
Assignment operator.
int numberSOS() const
Number of SOS if found.
OsiSolverInterface * modifiedModel(int iPass) const
Copies of solver at various stages after presolve after modifications.
OsiSolverInterface * originalModel() const
The original solver associated with this model.
CglCutGenerator * cutGenerator(int i) const
Get the specified cut generator.
OsiSolverInterface * startModel() const
Solver after making clique equalities (may == original)
OsiPresolve * presolve(int iPass) const
Matching presolve information.