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 void postProcess(OsiSolverInterface &model,
int deleteStuff = 2);
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;
121 return originalModel_;
136 return numberSolvers_;
141 if (iPass >= 0 && iPass < numberSolvers_)
142 return model_[iPass];
149 if (iPass >= 0 && iPass < numberSolvers_)
150 return modifiedModel_[iPass];
157 if (iPass >= 0 && iPass < numberSolvers_)
158 return presolve_[iPass];
165 if (iPass >= 0 && iPass < numberSolvers_)
209 return numberIterationsPre_;
214 return numberIterationsPost_;
244 void update(
const OsiPresolve *pinfo,
const OsiSolverInterface *solver);
262 return numberCutGenerators_;
272 return generator_[i];
342 void setTimeLimit(
const double timeLimit,
const bool useElapsedTime);
355 OsiSolverInterface *modified(OsiSolverInterface *model,
361 void createOriginalIndices();
373 OsiSolverInterface *originalModel_;
375 OsiSolverInterface *startModel_;
379 OsiSolverInterface **model_;
381 OsiSolverInterface **modifiedModel_;
383 OsiPresolve **presolve_;
386 CoinMessageHandler *handler_;
393 bool defaultHandler_;
396 CoinMessages messages_;
401 int *originalColumn_;
405 int numberCutGenerators_;
419 int numberProhibited_;
421 int numberIterationsPre_;
423 int numberIterationsPost_;
448 bool useElapsedTime_;
454 bool keepColumnNames_;
457 double getCurrentCPUTime()
const;
471 OsiSolverInterface *
newSolver(
const OsiSolverInterface &model);
495 CglBK(
const OsiSolverInterface &model,
const char *rowType,
519 CoinBigIndex *start_;
527 CoinPackedMatrix *cliqueMatrix_;
529 const char *rowType_;
537 int numberCandidates_;
561 inline OsiRowCut *
cut(
int sequence)
const
563 return rowCut_[sequence];
575 return rowCut_[sequence];
int options() const
Get options.
void setPresolve(int iPass, OsiPresolve *presolve)
Set matching presolve information.
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.
void setTimeLimit(const double timeLimit, const bool useElapsedTime)
Set time limit.
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.
Stored Cut Generator Class.
int numberSolvers() const
Number of solvers.
void postProcess(OsiSolverInterface &model, int deleteStuff=2)
Creates solution in original model deleteStuff 0 - don't, 1 do (but not if infeasible),...
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.
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.
void gutsOfDestructor()
Clears out as much as possible.
OsiSolverInterface * newSolver(const OsiSolverInterface &model)
Creates strengthened smaller model.
void setKeepColumnNames(const bool keep)
Keeps original column names.
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,...
int numberIterationsPre() const
Number of iterations PreProcessing.
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.
void setOriginalModel(OsiSolverInterface *originalModel)
Set original model (probably acopy)
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.