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];}
475 void eraseRowCut(
int sequence);
478 { insertIfNotDuplicate(cut);}
480 int insertIfNotDuplicate(
const OsiRowCut &
cut);
482 void addCuts(OsiCuts & cs);
484 OsiRowCut ** rowCut_;
void gutsOfDestructor()
Clears out as much as possible.
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...
int tightenPrimalBounds(OsiSolverInterface &model, double factor=0.0)
Tightens primal bounds to make dual and branch and cutfaster.
void newLanguage(CoinMessages::Language language)
Set language.
OsiSolverInterface * originalModel() const
The original solver associated with this model.
OsiSolverInterface * modifiedModel(int iPass) const
Copies of solver at various stages after presolve after modifications.
void addCutGenerator(CglCutGenerator *generator)
Add one generator - up to user to delete generators.
Only store unique row cuts.
Stored Cut Generator Class.
const double * weightSOS() const
Weights for each SOS column.
double getCutoff() const
Get the cutoff bound on the objective function - always as minimize.
void update(const OsiPresolve *pinfo, const OsiSolverInterface *solver)
Update prohibited and rowType.
void setApplicationData(void *appData)
Set application data.
CglPreProcess & operator=(const CglPreProcess &rhs)
Assignment operator.
void setLanguage(CoinMessages::Language language)
const int * whichSOS() const
Columns in SOS.
const CglStored & cuts() const
Return cuts from dropped rows.
void postProcess(OsiSolverInterface &model, bool deleteStuff=true)
Creates solution in original model.
OsiSolverInterface * modelAtPass(int iPass) const
Copies of solver at various stages after presolve.
void setOptions(int value)
Set options.
OsiSolverInterface * preProcessNonDefault(OsiSolverInterface &model, int makeEquality=0, int numberPasses=5, int tuning=0)
preProcess problem - returning new problem.
Cut Generator Base Class.
CglCutGenerator * cutGenerator(int i) const
Get the specified cut generator.
OsiSolverInterface * startModel() const
Solver after making clique equalities (may == original)
void passInMessageHandler(CoinMessageHandler *handler)
Pass in Message handler (not deleted at end)
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 insert(const OsiRowCut &cut)
int numberIterationsPost() const
Number of iterations PostProcessing.
const int * originalColumns()
Return a pointer to the original columns (with possible clique slacks) MUST be called before postProc...
CoinMessages * messagesPointer()
Return pointer to messages.
OsiSolverInterface * someFixed(OsiSolverInterface &model, double fractionToKeep=0.25, bool fixContinuousAsWell=false, char *keep=NULL) const
Fix some of problem - returning new problem.
CglPreProcess()
Constructor.
int numberSOS() const
Number of SOS if found.
CoinMessageHandler * messageHandler() const
Return handler.
void setCutoff(double value)
Set cutoff bound on the objective function.
void passInProhibited(const char *prohibited, int numberColumns)
Pass in prohibited columns.
CglCutGenerator ** cutGenerators() const
Get the list of cut generators.
OsiRowCut * rowCutPtr(int sequence)
OsiSolverInterface * preProcess(OsiSolverInterface &model, bool makeEquality=false, int numberPasses=5)
preProcess problem - returning new problem.
const char * rowTypes()
Updated row types - may be NULL Carried around and corresponds to existing rows -1 added by preproces...
const CglStored * cutsPointer() const
Return pointer to cuts from dropped rows.
const char * prohibited()
Updated prohibited columns.
OsiRowCut * cut(int sequence) const
Class for preProcessing and postProcessing.
OsiPresolve * presolve(int iPass) const
Matching presolve information.
void * getApplicationData() const
Get application data.
CoinMessages messages()
Return messages.
const int * startSOS() const
Start of each SOS.
int reducedCostFix(OsiSolverInterface &model)
If we have a cutoff - fix variables.
const int * typeSOS() const
Type of each SOS.
~CglPreProcess()
Destructor.
int numberCutGenerators() const
Get the number of cut generators.
const int * originalRows()
Return a pointer to the original rows MUST be called before postProcess otherwise you just get 0...
int numberIterationsPre() const
Number of iterations PreProcessing.