Clp 1.17.11
Loading...
Searching...
No Matches
ClpPresolve Class Reference

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

#include <ClpPresolve.hpp>

Collaboration diagram for ClpPresolve:

Public Member Functions

Main Constructor, destructor
 ClpPresolve ()
 Default constructor.
virtual ~ClpPresolve ()
 Virtual destructor.
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.
ClpSimplexmodel () const
 Return pointer to presolved model, Up to user to destroy.
ClpSimplexoriginalModel () const
 Return pointer to original model.
void setOriginalModel (ClpSimplex *model)
 Set pointer to original model.
const int * originalColumns () const
 return pointer to original columns
const int * originalRows () const
 return pointer to original rows
void setNonLinearValue (double value)
 "Magic" number.
double nonLinearValue () const
bool doDual () const
 Whether we want to do dual part of presolve.
void setDoDual (bool doDual)
bool doSingleton () const
 Whether we want to do singleton part of presolve.
void setDoSingleton (bool doSingleton)
bool doDoubleton () const
 Whether we want to do doubleton part of presolve.
void setDoDoubleton (bool doDoubleton)
bool doTripleton () const
 Whether we want to do tripleton part of presolve.
void setDoTripleton (bool doTripleton)
bool doTighten () const
 Whether we want to do tighten part of presolve.
void setDoTighten (bool doTighten)
bool doForcing () const
 Whether we want to do forcing part of presolve.
void setDoForcing (bool doForcing)
bool doImpliedFree () const
 Whether we want to do impliedfree part of presolve.
void setDoImpliedFree (bool doImpliedfree)
bool doDupcol () const
 Whether we want to do dupcol part of presolve.
void setDoDupcol (bool doDupcol)
bool doDuprow () const
 Whether we want to do duprow part of presolve.
void setDoDuprow (bool doDuprow)
bool doDependency () const
 Whether we want to do dependency part of presolve.
void setDoDependency (bool doDependency)
bool doTransfer () const
 Whether we want to do transfer part of presolve.
void setDoTransfer (bool doTransfer)
bool doSingletonColumn () const
 Whether we want to do singleton column part of presolve.
void setDoSingletonColumn (bool doSingleton)
bool doGubrow () const
 Whether we want to do gubrow part of presolve.
void setDoGubrow (bool doGubrow)
bool doTwoxTwo () const
 Whether we want to do twoxtwo part of presolve.
void setDoTwoxtwo (bool doTwoxTwo)
bool doIntersection () const
 Whether we want to allow duplicate intersections.
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.
void setZeroSmall (int value)
int presolveActions () const
 Set whole group.
void setPresolveActions (int action)
void setSubstitution (int value)
 Substitution level.
void statistics ()
 Asks for statistics.
int presolveStatus () const
 Return presolve status (0,1,2).

private or protected data

*Original model must not be destroyed before postsolve ClpSimplexoriginalModel_
*ClpPresolved model up to user to destroy by deleteClpPresolvedModel ClpSimplexpresolvedModel_
double nonLinearValue_
 "Magic" number.
*Original column numbers int * originalColumn_
*Original row numbers int * originalRow_
*Row objective double * rowObjective_
*The list of transformations applied const CoinPresolveAction * paction_
*The postsolved problem will expand back to its former size *as postsolve transformations are applied *It is efficient to allocate data structures for the final size *of the problem rather than expand them as needed *These fields give the size of the original problem int ncols_
int nrows_
CoinBigIndex nelems_
*Number of major passes int numberPasses_
*Substitution level int substitution_
*Name of saved model file std::string saveFile_
int presolveActions_
 Whether we want to skip dual part of presolve etc.
*If you want to apply the individual presolve routines differently
*If you want to apply the individual presolve routines *or perhaps add your own to the mix
*Postsolving is pretty generic
*If you want to apply the individual presolve routines *or perhaps add your own to the *define a derived class and override this method virtual const CoinPresolveAction * presolve (CoinPresolveMatrix *prob)
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 virtual techniques void postsolve (CoinPostsolveMatrix &prob)
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.

Detailed Description

This is the Clp interface to CoinPresolve.

Definition at line 15 of file ClpPresolve.hpp.

Constructor & Destructor Documentation

◆ ClpPresolve()

ClpPresolve::ClpPresolve ( )

Default constructor.

◆ ~ClpPresolve()

virtual ClpPresolve::~ClpPresolve ( )
virtual

Virtual destructor.

Member Function Documentation

◆ presolvedModel()

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 )

◆ presolvedModelToFile()

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

◆ model()

ClpSimplex * ClpPresolve::model ( ) const

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

◆ originalModel()

ClpSimplex * ClpPresolve::originalModel ( ) const

Return pointer to original model.

◆ setOriginalModel()

void ClpPresolve::setOriginalModel ( ClpSimplex * model)

Set pointer to original model.

◆ originalColumns()

const int * ClpPresolve::originalColumns ( ) const

return pointer to original columns

◆ originalRows()

const int * ClpPresolve::originalRows ( ) const

return pointer to original rows

◆ setNonLinearValue()

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.

◆ nonLinearValue()

double ClpPresolve::nonLinearValue ( ) const
inline

Definition at line 80 of file ClpPresolve.hpp.

◆ doDual()

bool ClpPresolve::doDual ( ) const
inline

Whether we want to do dual part of presolve.

Definition at line 85 of file ClpPresolve.hpp.

◆ setDoDual()

void ClpPresolve::setDoDual ( bool doDual)
inline

Definition at line 89 of file ClpPresolve.hpp.

◆ doSingleton()

bool ClpPresolve::doSingleton ( ) const
inline

Whether we want to do singleton part of presolve.

Definition at line 97 of file ClpPresolve.hpp.

◆ setDoSingleton()

void ClpPresolve::setDoSingleton ( bool doSingleton)
inline

Definition at line 101 of file ClpPresolve.hpp.

◆ doDoubleton()

bool ClpPresolve::doDoubleton ( ) const
inline

Whether we want to do doubleton part of presolve.

Definition at line 109 of file ClpPresolve.hpp.

◆ setDoDoubleton()

void ClpPresolve::setDoDoubleton ( bool doDoubleton)
inline

Definition at line 113 of file ClpPresolve.hpp.

◆ doTripleton()

bool ClpPresolve::doTripleton ( ) const
inline

Whether we want to do tripleton part of presolve.

Definition at line 121 of file ClpPresolve.hpp.

◆ setDoTripleton()

void ClpPresolve::setDoTripleton ( bool doTripleton)
inline

Definition at line 125 of file ClpPresolve.hpp.

◆ doTighten()

bool ClpPresolve::doTighten ( ) const
inline

Whether we want to do tighten part of presolve.

Definition at line 133 of file ClpPresolve.hpp.

◆ setDoTighten()

void ClpPresolve::setDoTighten ( bool doTighten)
inline

Definition at line 137 of file ClpPresolve.hpp.

◆ doForcing()

bool ClpPresolve::doForcing ( ) const
inline

Whether we want to do forcing part of presolve.

Definition at line 145 of file ClpPresolve.hpp.

◆ setDoForcing()

void ClpPresolve::setDoForcing ( bool doForcing)
inline

Definition at line 149 of file ClpPresolve.hpp.

◆ doImpliedFree()

bool ClpPresolve::doImpliedFree ( ) const
inline

Whether we want to do impliedfree part of presolve.

Definition at line 157 of file ClpPresolve.hpp.

◆ setDoImpliedFree()

void ClpPresolve::setDoImpliedFree ( bool doImpliedfree)
inline

Definition at line 161 of file ClpPresolve.hpp.

◆ doDupcol()

bool ClpPresolve::doDupcol ( ) const
inline

Whether we want to do dupcol part of presolve.

Definition at line 169 of file ClpPresolve.hpp.

◆ setDoDupcol()

void ClpPresolve::setDoDupcol ( bool doDupcol)
inline

Definition at line 173 of file ClpPresolve.hpp.

◆ doDuprow()

bool ClpPresolve::doDuprow ( ) const
inline

Whether we want to do duprow part of presolve.

Definition at line 181 of file ClpPresolve.hpp.

◆ setDoDuprow()

void ClpPresolve::setDoDuprow ( bool doDuprow)
inline

Definition at line 185 of file ClpPresolve.hpp.

◆ doDependency()

bool ClpPresolve::doDependency ( ) const
inline

Whether we want to do dependency part of presolve.

Definition at line 193 of file ClpPresolve.hpp.

◆ setDoDependency()

void ClpPresolve::setDoDependency ( bool doDependency)
inline

Definition at line 197 of file ClpPresolve.hpp.

◆ doTransfer()

bool ClpPresolve::doTransfer ( ) const
inline

Whether we want to do transfer part of presolve.

Definition at line 205 of file ClpPresolve.hpp.

◆ setDoTransfer()

void ClpPresolve::setDoTransfer ( bool doTransfer)
inline

Definition at line 209 of file ClpPresolve.hpp.

◆ doSingletonColumn()

bool ClpPresolve::doSingletonColumn ( ) const
inline

Whether we want to do singleton column part of presolve.

Definition at line 217 of file ClpPresolve.hpp.

◆ setDoSingletonColumn()

void ClpPresolve::setDoSingletonColumn ( bool doSingleton)
inline

Definition at line 221 of file ClpPresolve.hpp.

◆ doGubrow()

bool ClpPresolve::doGubrow ( ) const
inline

Whether we want to do gubrow part of presolve.

Definition at line 229 of file ClpPresolve.hpp.

◆ setDoGubrow()

void ClpPresolve::setDoGubrow ( bool doGubrow)
inline

Definition at line 233 of file ClpPresolve.hpp.

◆ doTwoxTwo()

bool ClpPresolve::doTwoxTwo ( ) const
inline

Whether we want to do twoxtwo part of presolve.

Definition at line 241 of file ClpPresolve.hpp.

◆ setDoTwoxtwo()

void ClpPresolve::setDoTwoxtwo ( bool doTwoxTwo)
inline

Definition at line 245 of file ClpPresolve.hpp.

◆ doIntersection()

bool ClpPresolve::doIntersection ( ) const
inline

Whether we want to allow duplicate intersections.

Definition at line 253 of file ClpPresolve.hpp.

◆ setDoIntersection()

void ClpPresolve::setDoIntersection ( bool doIntersection)
inline

Definition at line 257 of file ClpPresolve.hpp.

◆ zeroSmall()

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 266 of file ClpPresolve.hpp.

◆ setZeroSmall()

void ClpPresolve::setZeroSmall ( int value)
inline

Definition at line 270 of file ClpPresolve.hpp.

◆ presolveActions()

int ClpPresolve::presolveActions ( ) const
inline

Set whole group.

Definition at line 276 of file ClpPresolve.hpp.

◆ setPresolveActions()

void ClpPresolve::setPresolveActions ( int action)
inline

Definition at line 280 of file ClpPresolve.hpp.

◆ setSubstitution()

void ClpPresolve::setSubstitution ( int value)
inline

Substitution level.

Definition at line 285 of file ClpPresolve.hpp.

◆ statistics()

void ClpPresolve::statistics ( )
inline

Asks for statistics.

Definition at line 290 of file ClpPresolve.hpp.

◆ presolveStatus()

int ClpPresolve::presolveStatus ( ) const

Return presolve status (0,1,2).

◆ presolve()

*If you want to apply the individual presolve routines *or perhaps add your own to the *define a derived class and override this method virtual const CoinPresolveAction * ClpPresolve::presolve ( CoinPresolveMatrix * prob)
protected

◆ postsolve()

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 virtual techniques void ClpPresolve::postsolve ( CoinPostsolveMatrix & prob)
protectedvirtual

◆ gutsOfPresolvedModel()

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.

Member Data Documentation

◆ originalModel_

* Original model must not be destroyed before postsolve ClpSimplex* ClpPresolve::originalModel_
private

Definition at line 313 of file ClpPresolve.hpp.

◆ presolvedModel_

* ClpPresolved model up to user to destroy by deleteClpPresolvedModel ClpSimplex* ClpPresolve::presolvedModel_
private

Definition at line 316 of file ClpPresolve.hpp.

◆ nonLinearValue_

double ClpPresolve::nonLinearValue_
private

"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. One could also allow for cases where sign of coefficient is known.

Definition at line 322 of file ClpPresolve.hpp.

◆ originalColumn_

* Original column numbers int* ClpPresolve::originalColumn_
private

Definition at line 324 of file ClpPresolve.hpp.

◆ originalRow_

* Original row numbers int* ClpPresolve::originalRow_
private

Definition at line 326 of file ClpPresolve.hpp.

◆ rowObjective_

* Row objective double* ClpPresolve::rowObjective_
private

Definition at line 328 of file ClpPresolve.hpp.

◆ paction_

* The list of transformations applied const CoinPresolveAction* ClpPresolve::paction_
private

Definition at line 330 of file ClpPresolve.hpp.

◆ ncols_

* The postsolved problem will expand back to its former size* as postsolve transformations are applied* It is efficient to allocate data structures for the final size* of the problem rather than expand them as needed* These fields give the size of the original problem int ClpPresolve::ncols_
private

Definition at line 337 of file ClpPresolve.hpp.

◆ nrows_

int ClpPresolve::nrows_
private

Definition at line 338 of file ClpPresolve.hpp.

◆ nelems_

CoinBigIndex ClpPresolve::nelems_
private

Definition at line 339 of file ClpPresolve.hpp.

◆ numberPasses_

* Number of major passes int ClpPresolve::numberPasses_
private

Definition at line 341 of file ClpPresolve.hpp.

◆ substitution_

* Substitution level int ClpPresolve::substitution_
private

Definition at line 343 of file ClpPresolve.hpp.

◆ saveFile_

* Name of saved model file std::string ClpPresolve::saveFile_
private

Definition at line 346 of file ClpPresolve.hpp.

◆ presolveActions_

int ClpPresolve::presolveActions_
private

Whether we want to skip dual part of presolve etc.

512 bit allows duplicate column processing on integer columns and dual stuff on integers

Definition at line 352 of file ClpPresolve.hpp.

◆ differently

* If you want to apply the individual presolve routines ClpPresolve::differently
protected

Definition at line 355 of file ClpPresolve.hpp.

◆ mix

* If you want to apply the individual presolve routines * or perhaps add your own to the ClpPresolve::mix
protected

Definition at line 356 of file ClpPresolve.hpp.

◆ generic

* Postsolving is pretty ClpPresolve::generic
protected

Definition at line 360 of file ClpPresolve.hpp.


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