Cgl  0.59.10
List of all members
CglPreProcess Class Reference

Class for preProcessing and postProcessing. More...

#include <CglPreProcess.hpp>

Public Member Functions

Main methods
OsiSolverInterface * preProcess (OsiSolverInterface &model, bool makeEquality=false, int numberPasses=5)
 preProcess problem - returning new problem. More...
 
OsiSolverInterface * preProcessNonDefault (OsiSolverInterface &model, int makeEquality=0, int numberPasses=5, int tuning=0)
 preProcess problem - returning new problem. More...
 
void postProcess (OsiSolverInterface &model, bool deleteStuff=true)
 Creates solution in original model. More...
 
int tightenPrimalBounds (OsiSolverInterface &model, double factor=0.0)
 Tightens primal bounds to make dual and branch and cutfaster. More...
 
OsiSolverInterface * someFixed (OsiSolverInterface &model, double fractionToKeep=0.25, bool fixContinuousAsWell=false, char *keep=NULL) const
 Fix some of problem - returning new problem. More...
 
OsiSolverInterface * cliqueIt (OsiSolverInterface &model, double cliquesNeeded=0.0) const
 Replace cliques by more maximal cliques Returns NULL if rows not reduced by greater than cliquesNeeded*rows. More...
 
int reducedCostFix (OsiSolverInterface &model)
 If we have a cutoff - fix variables. More...
 
Parameter set/get methods

The set methods return true if the parameter was set to the given value, false if the value of the parameter is out of range.

The get methods return the value of the parameter.

void setCutoff (double value)
 Set cutoff bound on the objective function. More...
 
double getCutoff () const
 Get the cutoff bound on the objective function - always as minimize. More...
 
OsiSolverInterface * originalModel () const
 The original solver associated with this model. More...
 
OsiSolverInterface * startModel () const
 Solver after making clique equalities (may == original) More...
 
OsiSolverInterface * modelAtPass (int iPass) const
 Copies of solver at various stages after presolve. More...
 
OsiSolverInterface * modifiedModel (int iPass) const
 Copies of solver at various stages after presolve after modifications. More...
 
OsiPresolve * presolve (int iPass) const
 Matching presolve information. More...
 
const int * originalColumns ()
 Return a pointer to the original columns (with possible clique slacks) MUST be called before postProcess otherwise you just get 0,1,2. More...
 
const int * originalRows ()
 Return a pointer to the original rows MUST be called before postProcess otherwise you just get 0,1,2. More...
 
int numberSOS () const
 Number of SOS if found. More...
 
const int * typeSOS () const
 Type of each SOS. More...
 
const int * startSOS () const
 Start of each SOS. More...
 
const int * whichSOS () const
 Columns in SOS. More...
 
const double * weightSOS () const
 Weights for each SOS column. More...
 
void passInProhibited (const char *prohibited, int numberColumns)
 Pass in prohibited columns. More...
 
const char * prohibited ()
 Updated prohibited columns. More...
 
int numberIterationsPre () const
 Number of iterations PreProcessing. More...
 
int numberIterationsPost () const
 Number of iterations PostProcessing. More...
 
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 will be dropped and put into cuts. More...
 
const char * rowTypes ()
 Updated row types - may be NULL Carried around and corresponds to existing rows -1 added by preprocess e.g. More...
 
const CglStoredcuts () const
 Return cuts from dropped rows. More...
 
const CglStoredcutsPointer () const
 Return pointer to cuts from dropped rows. More...
 
void update (const OsiPresolve *pinfo, const OsiSolverInterface *solver)
 Update prohibited and rowType. More...
 
void setOptions (int value)
 Set options. More...
 
Cut generator methods
int numberCutGenerators () const
 Get the number of cut generators. More...
 
CglCutGenerator ** cutGenerators () const
 Get the list of cut generators. More...
 
CglCutGeneratorcutGenerator (int i) const
 Get the specified cut generator. More...
 
void addCutGenerator (CglCutGenerator *generator)
 Add one generator - up to user to delete generators. More...
 
Setting/Accessing application data
void setApplicationData (void *appData)
 Set application data. More...
 
void * getApplicationData () const
 Get application data. More...
 
Message handling
void passInMessageHandler (CoinMessageHandler *handler)
 Pass in Message handler (not deleted at end) More...
 
void newLanguage (CoinMessages::Language language)
 Set language. More...
 
void setLanguage (CoinMessages::Language language)
 
CoinMessageHandler * messageHandler () const
 Return handler. More...
 
CoinMessages messages ()
 Return messages. More...
 
CoinMessages * messagesPointer ()
 Return pointer to messages. More...
 
Constructors and destructors etc
 CglPreProcess ()
 Constructor. More...
 
 CglPreProcess (const CglPreProcess &rhs)
 Copy constructor . More...
 
CglPreProcessoperator= (const CglPreProcess &rhs)
 Assignment operator. More...
 
 ~CglPreProcess ()
 Destructor. More...
 
void gutsOfDestructor ()
 Clears out as much as possible. More...
 

Detailed Description

Class for preProcessing and postProcessing.

While cuts can be added at any time in the tree, some cuts are actually just stronger versions of existing constraints. In this case they can replace those constraints rather than being added as new constraints. This is awkward in the tree but reasonable at the root node.

This is a general process class which uses other cut generators to strengthen constraints, establish that constraints are redundant, fix variables and find relationships such as x + y == 1.

Presolve will also be done.

If row names existed they may be replaced by R0000000 etc

Definition at line 36 of file CglPreProcess.hpp.

Constructor & Destructor Documentation

◆ CglPreProcess() [1/2]

CglPreProcess::CglPreProcess ( )

Constructor.

◆ CglPreProcess() [2/2]

CglPreProcess::CglPreProcess ( const CglPreProcess rhs)

Copy constructor .

◆ ~CglPreProcess()

CglPreProcess::~CglPreProcess ( )

Destructor.

Member Function Documentation

◆ preProcess()

OsiSolverInterface* CglPreProcess::preProcess ( OsiSolverInterface &  model,
bool  makeEquality = false,
int  numberPasses = 5 
)

preProcess problem - returning new problem.

If makeEquality true then <= cliques converted to ==. Presolve will be done numberPasses times.

Returns NULL if infeasible

This version uses default strategy. For more control copy and edit code from this function i.e. call preProcessNonDefault

◆ preProcessNonDefault()

OsiSolverInterface* CglPreProcess::preProcessNonDefault ( OsiSolverInterface &  model,
int  makeEquality = 0,
int  numberPasses = 5,
int  tuning = 0 
)

preProcess problem - returning new problem.

If makeEquality true then <= cliques converted to ==. Presolve will be done numberPasses times.

Returns NULL if infeasible

This version assumes user has added cut generators to CglPreProcess object before calling it. As an example use coding in preProcess If makeEquality is 1 add slacks to get cliques, if 2 add slacks to get sos (but only if looks plausible) and keep sos info

◆ postProcess()

void CglPreProcess::postProcess ( OsiSolverInterface &  model,
bool  deleteStuff = true 
)

Creates solution in original model.

◆ tightenPrimalBounds()

int CglPreProcess::tightenPrimalBounds ( OsiSolverInterface &  model,
double  factor = 0.0 
)

Tightens primal bounds to make dual and branch and cutfaster.

Unless fixed or integral, bounds are slightly looser than they could be. Returns non-zero if problem infeasible Fudge for branch and bound - put bounds on columns of factor * largest value (at continuous) - should improve stability in branch and bound on infeasible branches (0.0 is off)

◆ someFixed()

OsiSolverInterface* CglPreProcess::someFixed ( OsiSolverInterface &  model,
double  fractionToKeep = 0.25,
bool  fixContinuousAsWell = false,
char *  keep = NULL 
) const

Fix some of problem - returning new problem.

Uses reduced costs. Optional signed character array 1 always keep, -1 always discard, 0 use djs

◆ cliqueIt()

OsiSolverInterface* CglPreProcess::cliqueIt ( OsiSolverInterface &  model,
double  cliquesNeeded = 0.0 
) const

Replace cliques by more maximal cliques Returns NULL if rows not reduced by greater than cliquesNeeded*rows.

◆ reducedCostFix()

int CglPreProcess::reducedCostFix ( OsiSolverInterface &  model)

If we have a cutoff - fix variables.

◆ setCutoff()

void CglPreProcess::setCutoff ( double  value)

Set cutoff bound on the objective function.

When using strict comparison, the bound is adjusted by a tolerance to avoid accidentally cutting off the optimal solution.

◆ getCutoff()

double CglPreProcess::getCutoff ( ) const

Get the cutoff bound on the objective function - always as minimize.

◆ originalModel()

OsiSolverInterface* CglPreProcess::originalModel ( ) const
inline

The original solver associated with this model.

Definition at line 119 of file CglPreProcess.hpp.

◆ startModel()

OsiSolverInterface* CglPreProcess::startModel ( ) const
inline

Solver after making clique equalities (may == original)

Definition at line 122 of file CglPreProcess.hpp.

◆ modelAtPass()

OsiSolverInterface* CglPreProcess::modelAtPass ( int  iPass) const
inline

Copies of solver at various stages after presolve.

Definition at line 125 of file CglPreProcess.hpp.

◆ modifiedModel()

OsiSolverInterface* CglPreProcess::modifiedModel ( int  iPass) const
inline

Copies of solver at various stages after presolve after modifications.

Definition at line 128 of file CglPreProcess.hpp.

◆ presolve()

OsiPresolve* CglPreProcess::presolve ( int  iPass) const
inline

Matching presolve information.

Definition at line 131 of file CglPreProcess.hpp.

◆ originalColumns()

const int* CglPreProcess::originalColumns ( )

Return a pointer to the original columns (with possible clique slacks) MUST be called before postProcess otherwise you just get 0,1,2.

◆ originalRows()

const int* CglPreProcess::originalRows ( )

Return a pointer to the original rows MUST be called before postProcess otherwise you just get 0,1,2.

◆ numberSOS()

int CglPreProcess::numberSOS ( ) const
inline

Number of SOS if found.

Definition at line 140 of file CglPreProcess.hpp.

◆ typeSOS()

const int* CglPreProcess::typeSOS ( ) const
inline

Type of each SOS.

Definition at line 143 of file CglPreProcess.hpp.

◆ startSOS()

const int* CglPreProcess::startSOS ( ) const
inline

Start of each SOS.

Definition at line 146 of file CglPreProcess.hpp.

◆ whichSOS()

const int* CglPreProcess::whichSOS ( ) const
inline

Columns in SOS.

Definition at line 149 of file CglPreProcess.hpp.

◆ weightSOS()

const double* CglPreProcess::weightSOS ( ) const
inline

Weights for each SOS column.

Definition at line 152 of file CglPreProcess.hpp.

◆ passInProhibited()

void CglPreProcess::passInProhibited ( const char *  prohibited,
int  numberColumns 
)

Pass in prohibited columns.

◆ prohibited()

const char* CglPreProcess::prohibited ( )
inline

Updated prohibited columns.

Definition at line 157 of file CglPreProcess.hpp.

◆ numberIterationsPre()

int CglPreProcess::numberIterationsPre ( ) const
inline

Number of iterations PreProcessing.

Definition at line 160 of file CglPreProcess.hpp.

◆ numberIterationsPost()

int CglPreProcess::numberIterationsPost ( ) const
inline

Number of iterations PostProcessing.

Definition at line 163 of file CglPreProcess.hpp.

◆ passInRowTypes()

void CglPreProcess::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 will be dropped and put into cuts.

◆ rowTypes()

const char* CglPreProcess::rowTypes ( )
inline

Updated row types - may be NULL Carried around and corresponds to existing rows -1 added by preprocess e.g.

x+y=1 0 normal 1 cut rows - can be dropped if wanted

Definition at line 178 of file CglPreProcess.hpp.

◆ cuts()

const CglStored& CglPreProcess::cuts ( ) const
inline

Return cuts from dropped rows.

Definition at line 181 of file CglPreProcess.hpp.

◆ cutsPointer()

const CglStored* CglPreProcess::cutsPointer ( ) const
inline

Return pointer to cuts from dropped rows.

Definition at line 184 of file CglPreProcess.hpp.

◆ update()

void CglPreProcess::update ( const OsiPresolve *  pinfo,
const OsiSolverInterface *  solver 
)

Update prohibited and rowType.

◆ setOptions()

void CglPreProcess::setOptions ( int  value)
inline

Set options.

Definition at line 189 of file CglPreProcess.hpp.

◆ numberCutGenerators()

int CglPreProcess::numberCutGenerators ( ) const
inline

Get the number of cut generators.

Definition at line 196 of file CglPreProcess.hpp.

◆ cutGenerators()

CglCutGenerator** CglPreProcess::cutGenerators ( ) const
inline

Get the list of cut generators.

Definition at line 199 of file CglPreProcess.hpp.

◆ cutGenerator()

CglCutGenerator* CglPreProcess::cutGenerator ( int  i) const
inline

Get the specified cut generator.

Definition at line 202 of file CglPreProcess.hpp.

◆ addCutGenerator()

void CglPreProcess::addCutGenerator ( CglCutGenerator generator)

Add one generator - up to user to delete generators.

◆ setApplicationData()

void CglPreProcess::setApplicationData ( void *  appData)

Set application data.

This is a pointer that the application can store into and retrieve. This field is available for the application to optionally define and use.

◆ getApplicationData()

void* CglPreProcess::getApplicationData ( ) const

Get application data.

◆ passInMessageHandler()

void CglPreProcess::passInMessageHandler ( CoinMessageHandler *  handler)

Pass in Message handler (not deleted at end)

◆ newLanguage()

void CglPreProcess::newLanguage ( CoinMessages::Language  language)

Set language.

◆ setLanguage()

void CglPreProcess::setLanguage ( CoinMessages::Language  language)
inline

Definition at line 232 of file CglPreProcess.hpp.

◆ messageHandler()

CoinMessageHandler* CglPreProcess::messageHandler ( ) const
inline

Return handler.

Definition at line 235 of file CglPreProcess.hpp.

◆ messages()

CoinMessages CglPreProcess::messages ( )
inline

Return messages.

Definition at line 238 of file CglPreProcess.hpp.

◆ messagesPointer()

CoinMessages* CglPreProcess::messagesPointer ( )
inline

Return pointer to messages.

Definition at line 241 of file CglPreProcess.hpp.

◆ operator=()

CglPreProcess& CglPreProcess::operator= ( const CglPreProcess rhs)

Assignment operator.

◆ gutsOfDestructor()

void CglPreProcess::gutsOfDestructor ( )

Clears out as much as possible.


The documentation for this class was generated from the following file: