Clp  1.16.6
List of all members
ClpPresolve Class Reference

This is the Clp interface to CoinPresolve. More...

#include <ClpPresolve.hpp>

Public Member Functions

Main Constructor, destructor
 ClpPresolve ()
 Default constructor. More...
 
virtual ~ClpPresolve ()
 Virtual destructor. More...
 
presolve - presolves a model, transforming the model

and saving information in the ClpPresolve object needed for postsolving.

This underlying (protected) method is virtual; the idea is that in the future, one could override this method to customize how the various presolve techniques are applied.

This version of presolve returns a pointer to a new presolved model. NULL if infeasible or unbounded. This should be paired with postsolve below. The advantage of going back to original model is that it will be exactly as it was i.e. 0.0 will not become 1.0e-19. If keepIntegers is true then bounds may be tightened in original. Bounds will be moved by up to feasibilityTolerance to try and stay feasible. Names will be dropped in presolved model if asked

ClpSimplexpresolvedModel (ClpSimplex &si, double feasibilityTolerance=0.0, bool keepIntegers=true, int numberPasses=5, bool dropNames=false, bool doRowObjective=false, const char *prohibitedRows=NULL, const char *prohibitedColumns=NULL)
 
int presolvedModelToFile (ClpSimplex &si, std::string fileName, double feasibilityTolerance=0.0, bool keepIntegers=true, int numberPasses=5, bool dropNames=false, bool doRowObjective=false)
 This version saves data in a file. More...
 
ClpSimplexmodel () const
 Return pointer to presolved model, Up to user to destroy. More...
 
ClpSimplexoriginalModel () const
 Return pointer to original model. More...
 
void setOriginalModel (ClpSimplex *model)
 Set pointer to original model. More...
 
const int * originalColumns () const
 return pointer to original columns More...
 
const int * originalRows () const
 return pointer to original rows More...
 
void setNonLinearValue (double value)
 "Magic" number. More...
 
double nonLinearValue () const
 
bool doDual () const
 Whether we want to do dual part of presolve. More...
 
void setDoDual (bool doDual)
 
bool doSingleton () const
 Whether we want to do singleton part of presolve. More...
 
void setDoSingleton (bool doSingleton)
 
bool doDoubleton () const
 Whether we want to do doubleton part of presolve. More...
 
void setDoDoubleton (bool doDoubleton)
 
bool doTripleton () const
 Whether we want to do tripleton part of presolve. More...
 
void setDoTripleton (bool doTripleton)
 
bool doTighten () const
 Whether we want to do tighten part of presolve. More...
 
void setDoTighten (bool doTighten)
 
bool doForcing () const
 Whether we want to do forcing part of presolve. More...
 
void setDoForcing (bool doForcing)
 
bool doImpliedFree () const
 Whether we want to do impliedfree part of presolve. More...
 
void setDoImpliedFree (bool doImpliedfree)
 
bool doDupcol () const
 Whether we want to do dupcol part of presolve. More...
 
void setDoDupcol (bool doDupcol)
 
bool doDuprow () const
 Whether we want to do duprow part of presolve. More...
 
void setDoDuprow (bool doDuprow)
 
bool doDependency () const
 Whether we want to do dependency part of presolve. More...
 
void setDoDependency (bool doDependency)
 
bool doSingletonColumn () const
 Whether we want to do singleton column part of presolve. More...
 
void setDoSingletonColumn (bool doSingleton)
 
bool doGubrow () const
 Whether we want to do gubrow part of presolve. More...
 
void setDoGubrow (bool doGubrow)
 
bool doTwoxTwo () const
 Whether we want to do twoxtwo part of presolve. More...
 
void setDoTwoxtwo (bool doTwoxTwo)
 
bool doIntersection () const
 Whether we want to allow duplicate intersections. More...
 
void setDoIntersection (bool doIntersection)
 
int zeroSmall () const
 How much we want to zero small values from aggregation - ratio 0 - 1.0e-12, 1 1.0e-11, 2 1.0e-10, 3 1.0e-9. More...
 
void setZeroSmall (int value)
 
int presolveActions () const
 Set whole group. More...
 
void setPresolveActions (int action)
 
void setSubstitution (int value)
 Substitution level. More...
 
void statistics ()
 Asks for statistics. More...
 
int presolveStatus () const
 Return presolve status (0,1,2) More...
 
postsolve - postsolve the problem. If the problem

has not been solved to optimality, there are no guarantees.

If you are using an algorithm like simplex that has a concept of "basic" rows/cols, then set updateStatus

Note that if you modified the original problem after presolving, then you must ``undo'' these modifications before calling postsolve. This version updates original

virtual void postsolve (bool updateStatus=true)
 
void destroyPresolve ()
 Gets rid of presolve actions (e.g.when infeasible) More...
 

private or protected data

virtual const CoinPresolveAction * presolve (CoinPresolveMatrix *prob)
 If you want to apply the individual presolve routines differently, or perhaps add your own to the mix, define a derived class and override this method. More...
 
virtual void postsolve (CoinPostsolveMatrix &prob)
 Postsolving is pretty generic; just apply the transformations in reverse order. More...
 
virtual ClpSimplexgutsOfPresolvedModel (ClpSimplex *originalModel, double feasibilityTolerance, bool keepIntegers, int numberPasses, bool dropNames, bool doRowObjective, const char *prohibitedRows=NULL, const char *prohibitedColumns=NULL)
 This is main part of Presolve. More...
 

Detailed Description

This is the Clp interface to CoinPresolve.

Definition at line 15 of file ClpPresolve.hpp.

Constructor & Destructor Documentation

ClpPresolve::ClpPresolve ( )

Default constructor.

virtual ClpPresolve::~ClpPresolve ( )
virtual

Virtual destructor.

Member Function Documentation

ClpSimplex* ClpPresolve::presolvedModel ( ClpSimplex si,
double  feasibilityTolerance = 0.0,
bool  keepIntegers = true,
int  numberPasses = 5,
bool  dropNames = false,
bool  doRowObjective = false,
const char *  prohibitedRows = NULL,
const char *  prohibitedColumns = NULL 
)
int ClpPresolve::presolvedModelToFile ( ClpSimplex si,
std::string  fileName,
double  feasibilityTolerance = 0.0,
bool  keepIntegers = true,
int  numberPasses = 5,
bool  dropNames = false,
bool  doRowObjective = false 
)

This version saves data in a file.

The passed in model is updated to be presolved model. Returns non-zero if infeasible

ClpSimplex* ClpPresolve::model ( ) const

Return pointer to presolved model, Up to user to destroy.

ClpSimplex* ClpPresolve::originalModel ( ) const

Return pointer to original model.

void ClpPresolve::setOriginalModel ( ClpSimplex model)

Set pointer to original model.

const int* ClpPresolve::originalColumns ( ) const

return pointer to original columns

const int* ClpPresolve::originalRows ( ) const

return pointer to original rows

void ClpPresolve::setNonLinearValue ( double  value)
inline

"Magic" number.

If this is non-zero then any elements with this value may change and so presolve is very limited in what can be done to the row and column. This is for non-linear problems.

Definition at line 76 of file ClpPresolve.hpp.

double ClpPresolve::nonLinearValue ( ) const
inline

Definition at line 79 of file ClpPresolve.hpp.

bool ClpPresolve::doDual ( ) const
inline

Whether we want to do dual part of presolve.

Definition at line 83 of file ClpPresolve.hpp.

void ClpPresolve::setDoDual ( bool  doDual)
inline

Definition at line 86 of file ClpPresolve.hpp.

bool ClpPresolve::doSingleton ( ) const
inline

Whether we want to do singleton part of presolve.

Definition at line 91 of file ClpPresolve.hpp.

void ClpPresolve::setDoSingleton ( bool  doSingleton)
inline

Definition at line 94 of file ClpPresolve.hpp.

bool ClpPresolve::doDoubleton ( ) const
inline

Whether we want to do doubleton part of presolve.

Definition at line 99 of file ClpPresolve.hpp.

void ClpPresolve::setDoDoubleton ( bool  doDoubleton)
inline

Definition at line 102 of file ClpPresolve.hpp.

bool ClpPresolve::doTripleton ( ) const
inline

Whether we want to do tripleton part of presolve.

Definition at line 107 of file ClpPresolve.hpp.

void ClpPresolve::setDoTripleton ( bool  doTripleton)
inline

Definition at line 110 of file ClpPresolve.hpp.

bool ClpPresolve::doTighten ( ) const
inline

Whether we want to do tighten part of presolve.

Definition at line 115 of file ClpPresolve.hpp.

void ClpPresolve::setDoTighten ( bool  doTighten)
inline

Definition at line 118 of file ClpPresolve.hpp.

bool ClpPresolve::doForcing ( ) const
inline

Whether we want to do forcing part of presolve.

Definition at line 123 of file ClpPresolve.hpp.

void ClpPresolve::setDoForcing ( bool  doForcing)
inline

Definition at line 126 of file ClpPresolve.hpp.

bool ClpPresolve::doImpliedFree ( ) const
inline

Whether we want to do impliedfree part of presolve.

Definition at line 131 of file ClpPresolve.hpp.

void ClpPresolve::setDoImpliedFree ( bool  doImpliedfree)
inline

Definition at line 134 of file ClpPresolve.hpp.

bool ClpPresolve::doDupcol ( ) const
inline

Whether we want to do dupcol part of presolve.

Definition at line 139 of file ClpPresolve.hpp.

void ClpPresolve::setDoDupcol ( bool  doDupcol)
inline

Definition at line 142 of file ClpPresolve.hpp.

bool ClpPresolve::doDuprow ( ) const
inline

Whether we want to do duprow part of presolve.

Definition at line 147 of file ClpPresolve.hpp.

void ClpPresolve::setDoDuprow ( bool  doDuprow)
inline

Definition at line 150 of file ClpPresolve.hpp.

bool ClpPresolve::doDependency ( ) const
inline

Whether we want to do dependency part of presolve.

Definition at line 155 of file ClpPresolve.hpp.

void ClpPresolve::setDoDependency ( bool  doDependency)
inline

Definition at line 158 of file ClpPresolve.hpp.

bool ClpPresolve::doSingletonColumn ( ) const
inline

Whether we want to do singleton column part of presolve.

Definition at line 163 of file ClpPresolve.hpp.

void ClpPresolve::setDoSingletonColumn ( bool  doSingleton)
inline

Definition at line 166 of file ClpPresolve.hpp.

bool ClpPresolve::doGubrow ( ) const
inline

Whether we want to do gubrow part of presolve.

Definition at line 171 of file ClpPresolve.hpp.

void ClpPresolve::setDoGubrow ( bool  doGubrow)
inline

Definition at line 174 of file ClpPresolve.hpp.

bool ClpPresolve::doTwoxTwo ( ) const
inline

Whether we want to do twoxtwo part of presolve.

Definition at line 179 of file ClpPresolve.hpp.

void ClpPresolve::setDoTwoxtwo ( bool  doTwoxTwo)
inline

Definition at line 182 of file ClpPresolve.hpp.

bool ClpPresolve::doIntersection ( ) const
inline

Whether we want to allow duplicate intersections.

Definition at line 187 of file ClpPresolve.hpp.

void ClpPresolve::setDoIntersection ( bool  doIntersection)
inline

Definition at line 190 of file ClpPresolve.hpp.

int ClpPresolve::zeroSmall ( ) const
inline

How much we want to zero small values from aggregation - ratio 0 - 1.0e-12, 1 1.0e-11, 2 1.0e-10, 3 1.0e-9.

Definition at line 196 of file ClpPresolve.hpp.

void ClpPresolve::setZeroSmall ( int  value)
inline

Definition at line 199 of file ClpPresolve.hpp.

int ClpPresolve::presolveActions ( ) const
inline

Set whole group.

Definition at line 204 of file ClpPresolve.hpp.

void ClpPresolve::setPresolveActions ( int  action)
inline

Definition at line 207 of file ClpPresolve.hpp.

void ClpPresolve::setSubstitution ( int  value)
inline

Substitution level.

Definition at line 211 of file ClpPresolve.hpp.

void ClpPresolve::statistics ( )
inline

Asks for statistics.

Definition at line 215 of file ClpPresolve.hpp.

int ClpPresolve::presolveStatus ( ) const

Return presolve status (0,1,2)

virtual void ClpPresolve::postsolve ( bool  updateStatus = true)
virtual
void ClpPresolve::destroyPresolve ( )

Gets rid of presolve actions (e.g.when infeasible)

virtual const CoinPresolveAction* ClpPresolve::presolve ( CoinPresolveMatrix *  prob)
protectedvirtual

If you want to apply the individual presolve routines differently, or perhaps add your own to the mix, define a derived class and override this method.

virtual void ClpPresolve::postsolve ( CoinPostsolveMatrix &  prob)
protectedvirtual

Postsolving is pretty generic; just apply the transformations in reverse order.

You will probably only be interested in overriding this method if you want to add code to test for consistency while debugging new presolve techniques.

virtual ClpSimplex* ClpPresolve::gutsOfPresolvedModel ( ClpSimplex originalModel,
double  feasibilityTolerance,
bool  keepIntegers,
int  numberPasses,
bool  dropNames,
bool  doRowObjective,
const char *  prohibitedRows = NULL,
const char *  prohibitedColumns = NULL 
)
protectedvirtual

This is main part of Presolve.


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