Osi 0.107.7

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | Friends | Related Functions | List of all members
CoinPresolveMatrix Class Reference

Augments CoinPrePostsolveMatrix with information about the problem that is only needed during presolve. More...

`#include <CoinPresolveMatrix.hpp>`

Inheritance diagram for CoinPresolveMatrix:
[legend]
Collaboration diagram for CoinPresolveMatrix:
[legend]

## Public Member Functions
| CoinPresolveMatrix (int ncols_alloc, int nrows_alloc, CoinBigIndex nelems_alloc)
| `Native' constructor More...
| CoinPresolveMatrix (int ncols0, double maxmin, ClpSimplex *si, int nrows, CoinBigIndex nelems, bool doStatus, double nonLinearVariable, double bulkRatio)
| Clp OSI constructor. More...
void | update_model (ClpSimplex *si, int nrows0, int ncols0, CoinBigIndex nelems0)
| Update the model held by a Clp OSI. More...
| CoinPresolveMatrix (int ncols0, double maxmin, OsiSolverInterface *si, int nrows, CoinBigIndex nelems, bool doStatus, double nonLinearVariable, const char *prohibited, const char *rowProhibited=NULL)
| Generic OSI constructor. More...
void | update_model (OsiSolverInterface *si, int nrows0, int ncols0, CoinBigIndex nelems0)
| Update the model held by a generic OSI. More...
| ~CoinPresolveMatrix ()
| Destructor. More...
void | change_bias (double change_amount)
| Adjust objective function constant offset. More...
void | statistics ()
| Say we want statistics - also set time. More...
double | feasibilityTolerance ()
| Return feasibility tolerance. More...
void | setFeasibilityTolerance (double val)
| Set feasibility tolerance. More...
int | status ()
| Returns problem status (0 = feasible, 1 = infeasible, 2 = unbounded) More...
void | setStatus (int status)
| Set problem status. More...
void | setPass (int pass=0)
| Set pass number. More...
void | setMaximumSubstitutionLevel (int level)
| Set Maximum substitution level (normally 3) More...
int | recomputeSums (int whichRow)
| Recompute row lhs bounds. More...
void | initializeStuff ()
| Allocate scratch arrays. More...
void | deleteStuff ()
| Free scratch arrays. More...
Functions to load the problem representation
void | setMatrix (const CoinPackedMatrix *mtx)
| Load the cofficient matrix. More...
int | countEmptyRows ()
| Count number of empty rows. More...
void | setVariableType (int i, int variableType)
| Set variable type information for a single variable. More...
void | setVariableType (const unsigned char *variableType, int lenParam)
| Set variable type information for all variables. More...
void | setVariableType (bool allIntegers, int lenParam)
| Set the type of all variables. More...
void | setAnyInteger (bool anyInteger=true)
| Set a flag for presence (true) or absence (false) of integer variables. More...
Functions to retrieve problem information
const CoinBigIndex * | getRowStarts () const
| Get row start vector for row-major packed matrix. More...
const int * | getColIndicesByRow () const
| Get vector of column indices for row-major packed matrix. More...
const double * | getElementsByRow () const
| Get vector of elements for row-major packed matrix. More...
bool | isInteger (int i) const
| Check for integrality of the specified variable. More...
bool | anyInteger () const
| Check if there are any integer variables. More...
int | presolveOptions () const
| Picks up any special options. More...
void | setPresolveOptions (int value)
| Sets any special options (see presolveOptions_) More...
Functions to manipulate row and column processing status
void | initColsToDo ()
| Initialise the column ToDo lists. More...
int | stepColsToDo ()
| Step column ToDo lists. More...
int | numberColsToDo ()
| Return the number of columns on the colsToDo_ list. More...
bool | colChanged (int i) const
| Has column been changed? More...
void | unsetColChanged (int i)
| Mark column as not changed. More...
void | setColChanged (int i)
| Mark column as changed. More...
void | addCol (int i)
| Mark column as changed and add to list of columns to process next. More...
bool | colProhibited (int i) const
| Test if column is eligible for preprocessing. More...
bool | colProhibited2 (int i) const
| Test if column is eligible for preprocessing. More...
void | setColProhibited (int i)
| Mark column as ineligible for preprocessing. More...
bool | colUsed (int i) const
| Test if column is marked as used. More...
void | setColUsed (int i)
| Mark column as used. More...
void | unsetColUsed (int i)
| Mark column as unused. More...
bool | colInfinite (int i) const
| Has column infinite ub (originally) More...
void | unsetColInfinite (int i)
| Mark column as not infinite ub (originally) More...
void | setColInfinite (int i)
| Mark column as infinite ub (originally) More...
void | initRowsToDo ()
| Initialise the row ToDo lists. More...
int | stepRowsToDo ()
| Step row ToDo lists. More...
int | numberRowsToDo ()
| Return the number of rows on the rowsToDo_ list. More...
bool | rowChanged (int i) const
| Has row been changed? More...
void | unsetRowChanged (int i)
| Mark row as not changed. More...
void | setRowChanged (int i)
| Mark row as changed. More...
void | addRow (int i)
| Mark row as changed and add to list of rows to process next. More...
bool | rowProhibited (int i) const
| Test if row is eligible for preprocessing. More...
bool | rowProhibited2 (int i) const
| Test if row is eligible for preprocessing. More...
void | setRowProhibited (int i)
| Mark row as ineligible for preprocessing. More...
bool | rowUsed (int i) const
| Test if row is marked as used. More...
void | setRowUsed (int i)
| Mark row as used. More...
void | unsetRowUsed (int i)
| Mark row as unused. More...
bool | anyProhibited () const
| Check if there are any prohibited rows or columns. More...
void | setAnyProhibited (bool val=true)
| Set a flag for presence of prohibited rows or columns. More...
Public Member Functions inherited from CoinPrePostsolveMatrix
| CoinPrePostsolveMatrix (int ncols_alloc, int nrows_alloc, CoinBigIndex nelems_alloc)
| `Native' constructor More...
| CoinPrePostsolveMatrix (const OsiSolverInterface *si, int ncols_, int nrows_, CoinBigIndex nelems_)
| Generic OSI constructor. More...
| CoinPrePostsolveMatrix (const ClpSimplex *si, int ncols_, int nrows_, CoinBigIndex nelems_, double bulkRatio)
| ClpOsi constructor. More...
| ~CoinPrePostsolveMatrix ()
| Destructor. More...
void | setRowStatus (int sequence, Status status)
| Set row status (i.e., status of artificial for this row) More...
Status | getRowStatus (int sequence) const
| Get row status. More...
bool | rowIsBasic (int sequence) const
| Check if artificial for this row is basic. More...
void | setColumnStatus (int sequence, Status status)
| Set column status (i.e., status of primal variable) More...
Status | getColumnStatus (int sequence) const
| Get column (structural variable) status. More...
bool | columnIsBasic (int sequence) const
| Check if column (structural variable) is basic. More...
void | setRowStatusUsingValue (int iRow)
| Set status of row (artificial variable) to the correct nonbasic status given bounds and current value. More...
void | setColumnStatusUsingValue (int iColumn)
| Set status of column (structural variable) to the correct nonbasic status given bounds and current value. More...
void | setStructuralStatus (const char *strucStatus, int lenParam)
| Set column (structural variable) status vector. More...
void | setArtificialStatus (const char *artifStatus, int lenParam)
| Set row (artificial variable) status vector. More...
void | setStatus (const CoinWarmStartBasis *basis)
| Set the status of all variables from a basis. More...
CoinWarmStartBasis * | getStatus ()
| Get status in the form of a CoinWarmStartBasis. More...
const char * | columnStatusString (int j) const
| Return a print string for status of a column (structural variable) More...
const char * | rowStatusString (int i) const
| Return a print string for status of a row (artificial variable) More...
void | setObjOffset (double offset)
| Set the objective function offset for the original system. More...
void | setObjSense (double objSense)
| Set the objective sense (max/min) More...
void | setPrimalTolerance (double primTol)
| Set the primal feasibility tolerance. More...
void | setDualTolerance (double dualTol)
| Set the dual feasibility tolerance. More...
void | setColLower (const double *colLower, int lenParam)
| Set column lower bounds. More...
void | setColUpper (const double *colUpper, int lenParam)
| Set column upper bounds. More...
void | setColSolution (const double *colSol, int lenParam)
| Set column solution. More...
void | setCost (const double *cost, int lenParam)
| Set objective coefficients. More...
void | setReducedCost (const double *redCost, int lenParam)
| Set reduced costs. More...
void | setRowLower (const double *rowLower, int lenParam)
| Set row lower bounds. More...
void | setRowUpper (const double *rowUpper, int lenParam)
| Set row upper bounds. More...
void | setRowPrice (const double *rowSol, int lenParam)
| Set row solution. More...
void | setRowActivity (const double *rowAct, int lenParam)
| Set row activity. More...
int | getNumCols () const
| Get current number of columns. More...
int | getNumRows () const
| Get current number of rows. More...
int | getNumElems () const
| Get current number of non-zero coefficients. More...
const CoinBigIndex * | getColStarts () const
| Get column start vector for column-major packed matrix. More...
const int * | getColLengths () const
| Get column length vector for column-major packed matrix. More...
const int * | getRowIndicesByCol () const
| Get vector of row indices for column-major packed matrix. More...
const double * | getElementsByCol () const
| Get vector of elements for column-major packed matrix. More...
const double * | getColLower () const
| Get column lower bounds. More...
const double * | getColUpper () const
| Get column upper bounds. More...
const double * | getCost () const
| Get objective coefficients. More...
const double * | getRowLower () const
| Get row lower bounds. More...
const double * | getRowUpper () const
| Get row upper bounds. More...
const double * | getColSolution () const
| Get column solution (primal variable values) More...
const double * | getRowActivity () const
| Get row activity (constraint lhs values) More...
const double * | getRowPrice () const
| Get row solution (dual variables) More...
const double * | getReducedCost () const
| Get reduced costs. More...
int | countEmptyCols ()
| Count empty columns. More...
CoinMessageHandler * | messageHandler () const
| Return message handler. More...
void | setMessageHandler (CoinMessageHandler *handler)
| Set message handler. More...
CoinMessages | messages () const
| Return messages. More...

## Public Attributes
double | dobias_
| Objective function offset introduced during presolve. More...
unsigned char * | integerType_
| Tracks integrality of columns (1 for integer, 0 for continuous) More...
bool | anyInteger_
| Flag to say if any variables are integer. More...
bool | tuning_
| Print statistics for tuning. More...
double | startTime_
| Start time of presolve. More...
double | feasibilityTolerance_
| Bounds can be moved by this to retain feasibility. More...
int | status_
| Output status: 0 = feasible, 1 = infeasible, 2 = unbounded. More...
int | pass_
| Presolve pass number. More...
int | maxSubstLevel_
| Maximum substitution level. More...
Matrix storage management links
Linked lists, modelled after the linked lists used in OSL factorization. They are used for management of the bulk coefficient and minor index storage areas.
presolvehlink * | clink_
| Linked list for the column-major representation. More...
presolvehlink * | rlink_
| Linked list for the row-major representation. More...
Row-major representation
Common row-major format: A pair of vectors with positional correspondence to hold coefficients and column indices, and a second pair of vectors giving the starting position and length of each row in the first pair.
CoinBigIndex * | mrstrt_
| Vector of row start positions in #hcol, rowels_. More...
int * | hinrow_
| Vector of row lengths. More...
double * | rowels_
| Coefficients (positional correspondence with hcol_) More...
int * | hcol_
| Column indices (positional correspondence with rowels_) More...
Row and column processing status
Information used to determine if rows or columns can be changed and if they require further processing due to changes. There are four major lists: the [row,col]ToDo list, and the [row,col]NextToDo list. In general, a transform processes entries from the ToDo list and adds entries to the NextToDo list. There are two vectors, [row,col]Changed, which track the status of individual rows and columns.
unsigned char * | colChanged_
| Column change status information. More...
int * | colsToDo_
| Input list of columns to process. More...
int | numberColsToDo_
| Length of colsToDo_. More...
int * | nextColsToDo_
| Output list of columns to process next. More...
int | numberNextColsToDo_
| Length of nextColsToDo_. More...
unsigned char * | rowChanged_
| Row change status information. More...
int * | rowsToDo_
| Input list of rows to process. More...
int | numberRowsToDo_
| Length of rowsToDo_. More...
int * | nextRowsToDo_
| Output list of rows to process next. More...
int | numberNextRowsToDo_
| Length of nextRowsToDo_. More...
int | presolveOptions_
| Fine control over presolve actions. More...
bool | anyProhibited_
| Flag to say if any rows or columns are marked as prohibited. More...
Scratch work arrays
Preallocated work arrays are useful to avoid having to allocate and free work arrays in individual presolve methods. All are allocated from setMatrix by initializeStuff, freed from ~CoinPresolveMatrix. You can use deleteStuff followed by initializeStuff to remove and recreate them.
int * | usefulRowInt_
| Preallocated scratch work array, 3*nrows_. More...
double * | usefulRowDouble_
| Preallocated scratch work array, 2*nrows_. More...
int * | usefulColumnInt_
| Preallocated scratch work array, 2*ncols_. More...
double * | usefulColumnDouble_
| Preallocated scratch work array, ncols_. More...
double * | randomNumber_
| Array of random numbers (max row,column) More...
int * | infiniteUp_
| Work array for count of infinite contributions to row lhs upper bound. More...
double * | sumUp_
| Work array for sum of finite contributions to row lhs upper bound. More...
int * | infiniteDown_
| Work array for count of infinite contributions to row lhs lower bound. More...
double * | sumDown_
| Work array for sum of finite contributions to row lhs lower bound. More...
Public Attributes inherited from CoinPrePostsolveMatrix
int | ncols_
| current number of columns More...
int | nrows_
| current number of rows More...
CoinBigIndex | nelems_
| current number of coefficients More...
int | ncols0_
| Allocated number of columns. More...
int | nrows0_
| Allocated number of rows. More...
CoinBigIndex | nelems0_
| Allocated number of coefficients. More...
CoinBigIndex | bulk0_
| Allocated size of bulk storage for row indices and coefficients. More...
double | bulkRatio_
| Ratio of bulk0_ to nelems0_; default is 2. More...
CoinBigIndex * | mcstrt_
| Vector of column start positions in hrow_, colels_. More...
int * | hincol_
| Vector of column lengths. More...
int * | hrow_
| Row indices (positional correspondence with colels_) More...
double * | colels_
| Coefficients (positional correspondence with hrow_) More...
double * | cost_
| Objective coefficients. More...
double | originalOffset_
| Original objective offset. More...
double * | clo_
| Column (primal variable) lower bounds. More...
double * | cup_
| Column (primal variable) upper bounds. More...
double * | rlo_
| Row (constraint) lower bounds. More...
double * | rup_
| Row (constraint) upper bounds. More...
int * | originalColumn_
| Original column numbers. More...
int * | originalRow_
| Original row numbers. More...
double | ztolzb_
| Primal feasibility tolerance. More...
double | ztoldj_
| Dual feasibility tolerance. More...
double | maxmin_
| Maximization/minimization. More...
double * | sol_
| Vector of primal variable values. More...
double * | rowduals_
| Vector of dual variable values. More...
double * | acts_
| Vector of constraint left-hand-side values (row activity) More...
double * | rcosts_
| Vector of reduced costs. More...
unsigned char * | colstat_
| Status of primal variables. More...
unsigned char * | rowstat_
| Status of constraints. More...
CoinMessageHandler * | handler_
| Message handler. More...
bool | defaultHandler_
| Indicates if the current handler_ is default (true) or not (false). More...
CoinMessage | messages_
| Standard COIN messages. More...

## Friends
void | assignPresolveToPostsolve (CoinPresolveMatrix *&preObj)
| Initialize a CoinPostsolveMatrix object, destroying the CoinPresolveMatrix object. More...

## Related Functions
(Note that these are not member functions.)
void | presolve_no_dups (const CoinPresolveMatrix *preObj, bool doCol=true, bool doRow=true)
| Check column-major and/or row-major matrices for duplicate entries in the major vectors. More...
void | presolve_links_ok (const CoinPresolveMatrix *preObj, bool doCol=true, bool doRow=true)
| Check the links which track storage order for major vectors in the bulk storage area. More...
void | presolve_no_zeros (const CoinPresolveMatrix *preObj, bool doCol=true, bool doRow=true)
| Check for explicit zeros in the column- and/or row-major matrices. More...
void | presolve_consistent (const CoinPresolveMatrix *preObj, bool chkvals=true)
| Checks for equivalence of the column- and row-major matrices. More...
void | presolve_check_sol (const CoinPresolveMatrix *preObj, int chkColSol=2, int chkRowAct=1, int chkStatus=1)
| Check primal solution and architectural variable status. More...
void | presolve_check_nbasic (const CoinPresolveMatrix *preObj)
| Check for the proper number of basic variables. More...
Related Functions inherited from CoinPrePostsolveMatrix
const char * | statusName (CoinPrePostsolveMatrix::Status status)
| Generate a print string for a status code. More...
void | presolve_make_memlists (int *lengths, presolvehlink *link, int n)
| Initialise linked list for major vector order in bulk storage. More...
bool | presolve_expand_major (CoinBigIndex *majstrts, double *majels, int *minndxs, int *majlens, presolvehlink *majlinks, int nmaj, int k)
| Make sure a major-dimension vector k has room for one more coefficient. More...
bool | presolve_expand_col (CoinBigIndex *mcstrt, double *colels, int *hrow, int *hincol, presolvehlink *clink, int ncols, int colx)
| Make sure a column (colx) in a column-major matrix has room for one more coefficient. More...
bool | presolve_expand_row (CoinBigIndex *mrstrt, double *rowels, int *hcol, int *hinrow, presolvehlink *rlink, int nrows, int rowx)
| Make sure a row (rowx) in a row-major matrix has room for one more coefficient. More...
CoinBigIndex | presolve_find_minor (int tgt, CoinBigIndex ks, CoinBigIndex ke, const int *minndxs)
| Find position of a minor index in a major vector. More...
CoinBigIndex | presolve_find_row (int row, CoinBigIndex kcs, CoinBigIndex kce, const int *hrow)
| Find position of a row in a column in a column-major matrix. More...
CoinBigIndex | presolve_find_minor1 (int tgt, CoinBigIndex ks, CoinBigIndex ke, const int *minndxs)
| Find position of a minor index in a major vector. More...
CoinBigIndex | presolve_find_row1 (int row, CoinBigIndex kcs, CoinBigIndex kce, const int *hrow)
| Find position of a row in a column in a column-major matrix. More...
CoinBigIndex | presolve_find_col1 (int col, CoinBigIndex krs, CoinBigIndex kre, const int *hcol)
| Find position of a column in a row in a row-major matrix. More...
void | presolve_delete_from_major (int majndx, int minndx, const CoinBigIndex *majstrts, int *majlens, int *minndxs, double *els)
| Delete the entry for a minor index from a major vector. More...
void | presolve_delete_many_from_major (int majndx, char *marked, const CoinBigIndex *majstrts, int *majlens, int *minndxs, double *els)
| Delete marked entries. More...
void | presolve_delete_from_col (int row, int col, const CoinBigIndex *mcstrt, int *hincol, int *hrow, double *colels)
| Delete the entry for row `row` from column `col` in a column-major matrix. More...
void | presolve_delete_from_row (int row, int col, const CoinBigIndex *mrstrt, int *hinrow, int *hcol, double *rowels)
| Delete the entry for column `col` from row `row` in a row-major matrix. More...

## Additional Inherited Members
Public Types inherited from CoinPrePostsolveMatrix
enum | Status { isFree = 0x00, basic = 0x01, atUpperBound = 0x02, atLowerBound = 0x03, superBasic = 0x04 }
| Enum for status of various sorts. More...

## Detailed Description

Augments CoinPrePostsolveMatrix with information about the problem that is only needed during presolve.

For problem manipulation, this class adds a row-major matrix representation, linked lists that allow for easy manipulation of the matrix when applying presolve transforms, and vectors to track row and column processing status (changed, needs further processing, change prohibited)

For problem representation, this class adds information about variable type (integer or continuous), an objective offset, and a feasibility tolerance.

NOTE that the anyInteger_ and anyProhibited_ flags are independent of the vectors used to track this information for individual variables (integerType_ and rowChanged_ and colChanged_, respectively).

NOTE also that at the end of presolve the column-major and row-major matrix representations are loosely packed (i.e., there may be gaps between columns in the bulk storage arrays).

NOTE that while you might think that CoinPresolve is prepared to handle minimisation or maximisation, it's unlikely that this still works. This is a good thing: better to convert objective coefficients and duals once, before starting presolve, rather than doing it over and over in each transform that considers dual variables.

The constructors that take an OSI or ClpSimplex as a parameter really should not be here, but for historical reasons they will likely remain for the forseeable future. – lh, 111202 –

Definition at line 835 of file CoinPresolveMatrix.hpp.

## Constructor & Destructor Documentation

CoinPresolveMatrix::CoinPresolveMatrix | ( | int | ncols_alloc,
|  | int | nrows_alloc,
|  | CoinBigIndex | nelems_alloc
| ) |  |

`Native' constructor

This constructor creates an empty object which must then be loaded. On the other hand, it doesn't assume that the client is an OsiSolverInterface.

CoinPresolveMatrix::CoinPresolveMatrix | ( | int | ncols0,
|  | double | maxmin,
|  | ClpSimplex * | si,
|  | int | nrows,
|  | CoinBigIndex | nelems,
|  | bool | doStatus,
|  | double | nonLinearVariable,
|  | double | bulkRatio
| ) |  |

Clp OSI constructor.

See Clp code for the definition.

CoinPresolveMatrix::CoinPresolveMatrix | ( | int | ncols0,
|  | double | maxmin,
|  | OsiSolverInterface * | si,
|  | int | nrows,
|  | CoinBigIndex | nelems,
|  | bool | doStatus,
|  | double | nonLinearVariable,
|  | const char * | prohibited,
|  | const char * | rowProhibited = `NULL`
| ) |  |

Generic OSI constructor.

See OSI code for the definition.

CoinPresolveMatrix::~CoinPresolveMatrix | ( |  | ) |

Destructor.

## Member Function Documentation

void CoinPresolveMatrix::update_model | ( | ClpSimplex * | si,
|  | int | nrows0,
|  | int | ncols0,
|  | CoinBigIndex | nelems0
| ) |  |

Update the model held by a Clp OSI.

void CoinPresolveMatrix::update_model | ( | OsiSolverInterface * | si,
|  | int | nrows0,
|  | int | ncols0,
|  | CoinBigIndex | nelems0
| ) |  |

Update the model held by a generic OSI.

void CoinPresolveMatrix::setMatrix | ( | const CoinPackedMatrix * | mtx | ) |

Load the cofficient matrix.

Load the coefficient matrix before loading the other vectors (bounds, objective, variable type) required to define the problem.

int CoinPresolveMatrix::countEmptyRows | ( |  | ) |
| inline

Count number of empty rows.

Definition at line 913 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setVariableType | ( | int | i,
|  | int | variableType
| ) |  |
| inline

Set variable type information for a single variable.

Set `variableType` to 0 for continous, 1 for integer. Does not manipulate the anyInteger_ flag.

Definition at line 923 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setVariableType | ( | const unsigned char * | variableType,
|  | int | lenParam
| ) |  |

Set variable type information for all variables.

Set `variableType`[i] to 0 for continuous, 1 for integer. Does not manipulate the anyInteger_ flag.

void CoinPresolveMatrix::setVariableType | ( | bool | allIntegers,
|  | int | lenParam
| ) |  |

Set the type of all variables.

allIntegers should be true to set the type to integer, false to set the type to continuous.

void CoinPresolveMatrix::setAnyInteger | ( | bool | anyInteger = `true` | ) |
| inline

Set a flag for presence (true) or absence (false) of integer variables.

Definition at line 942 of file CoinPresolveMatrix.hpp.

const CoinBigIndex* CoinPresolveMatrix::getRowStarts | ( |  | ) | const
| inline

Get row start vector for row-major packed matrix.

Definition at line 951 of file CoinPresolveMatrix.hpp.

const int* CoinPresolveMatrix::getColIndicesByRow | ( |  | ) | const
| inline

Get vector of column indices for row-major packed matrix.

Definition at line 954 of file CoinPresolveMatrix.hpp.

const double* CoinPresolveMatrix::getElementsByRow | ( |  | ) | const
| inline

Get vector of elements for row-major packed matrix.

Definition at line 957 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::isInteger | ( | int | i | ) | const
| inline

Check for integrality of the specified variable.

Consults the integerType_ vector if present; fallback is the anyInteger_ flag.

Definition at line 965 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::anyInteger | ( |  | ) | const
| inline

Check if there are any integer variables.

Consults the anyInteger_ flag

Definition at line 978 of file CoinPresolveMatrix.hpp.

int CoinPresolveMatrix::presolveOptions | ( |  | ) | const
| inline

Picks up any special options.

Definition at line 981 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setPresolveOptions | ( | int | value | ) |
| inline

Sets any special options (see presolveOptions_)

Definition at line 984 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::change_bias | ( | double | change_amount | ) |
| inline

Adjust objective function constant offset.

Definition at line 1005 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::statistics | ( |  | ) |

Say we want statistics - also set time.

double CoinPresolveMatrix::feasibilityTolerance | ( |  | ) |
| inline

Return feasibility tolerance.

Definition at line 1052 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setFeasibilityTolerance | ( | double | val | ) |
| inline

Set feasibility tolerance.

Definition at line 1055 of file CoinPresolveMatrix.hpp.

int CoinPresolveMatrix::status | ( |  | ) |
| inline

Returns problem status (0 = feasible, 1 = infeasible, 2 = unbounded)

Definition at line 1065 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setStatus | ( | int | status | ) |
| inline

Set problem status.

Definition at line 1068 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setPass | ( | int | pass = `0` | ) |
| inline

Set pass number.

Definition at line 1080 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setMaximumSubstitutionLevel | ( | int | level | ) |
| inline

Set Maximum substitution level (normally 3)

Definition at line 1089 of file CoinPresolveMatrix.hpp.

int CoinPresolveMatrix::recomputeSums | ( | int | whichRow | ) |

Recompute row lhs bounds.

Calculate finite contributions to row lhs upper and lower bounds and count infinite contributions. Returns the number of rows found to be infeasible.

If `whichRow` < 0, bounds are recomputed for all rows.

As of 110611, this seems to be a work in progress in the sense that it's barely used by the existing presolve code.

void CoinPresolveMatrix::initializeStuff | ( |  | ) |

Allocate scratch arrays.

void CoinPresolveMatrix::deleteStuff | ( |  | ) |

Free scratch arrays.

void CoinPresolveMatrix::initColsToDo | ( |  | ) |

Initialise the column ToDo lists.

Places all columns in the colsToDo_ list except for columns marked as prohibited (viz. colChanged_).

int CoinPresolveMatrix::stepColsToDo | ( |  | ) |

Step column ToDo lists.

Moves columns on the nextColsToDo_ list to the colsToDo_ list, emptying nextColsToDo_. Returns the number of columns transferred.

int CoinPresolveMatrix::numberColsToDo | ( |  | ) |
| inline

Return the number of columns on the colsToDo_ list.

Definition at line 1237 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::colChanged | ( | int | i | ) | const
| inline

Has column been changed?

Definition at line 1241 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::unsetColChanged | ( | int | i | ) |
| inline

Mark column as not changed.

Definition at line 1245 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setColChanged | ( | int | i | ) |
| inline

Mark column as changed.

Definition at line 1249 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::addCol | ( | int | i | ) |
| inline

Mark column as changed and add to list of columns to process next.

Definition at line 1253 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::colProhibited | ( | int | i | ) | const
| inline

Test if column is eligible for preprocessing.

Definition at line 1260 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::colProhibited2 | ( | int | i | ) | const
| inline

Test if column is eligible for preprocessing.

The difference between this method and colProhibited() is that this method first tests anyProhibited_ before examining the specific entry for the specified column.

Definition at line 1269 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setColProhibited | ( | int | i | ) |
| inline

Mark column as ineligible for preprocessing.

Definition at line 1276 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::colUsed | ( | int | i | ) | const
| inline

Test if column is marked as used.

This is for doing faster lookups to see where two columns have entries in common.

Definition at line 1284 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setColUsed | ( | int | i | ) |
| inline

Mark column as used.

Definition at line 1288 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::unsetColUsed | ( | int | i | ) |
| inline

Mark column as unused.

Definition at line 1292 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::colInfinite | ( | int | i | ) | const
| inline

Has column infinite ub (originally)

Definition at line 1296 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::unsetColInfinite | ( | int | i | ) |
| inline

Mark column as not infinite ub (originally)

Definition at line 1300 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setColInfinite | ( | int | i | ) |
| inline

Mark column as infinite ub (originally)

Definition at line 1304 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::initRowsToDo | ( |  | ) |

Initialise the row ToDo lists.

Places all rows in the rowsToDo_ list except for rows marked as prohibited (viz. rowChanged_).

int CoinPresolveMatrix::stepRowsToDo | ( |  | ) |

Step row ToDo lists.

Moves rows on the nextRowsToDo_ list to the rowsToDo_ list, emptying nextRowsToDo_. Returns the number of rows transferred.

int CoinPresolveMatrix::numberRowsToDo | ( |  | ) |
| inline

Return the number of rows on the rowsToDo_ list.

Definition at line 1323 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::rowChanged | ( | int | i | ) | const
| inline

Has row been changed?

Definition at line 1327 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::unsetRowChanged | ( | int | i | ) |
| inline

Mark row as not changed.

Definition at line 1331 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setRowChanged | ( | int | i | ) |
| inline

Mark row as changed.

Definition at line 1335 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::addRow | ( | int | i | ) |
| inline

Mark row as changed and add to list of rows to process next.

Definition at line 1339 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::rowProhibited | ( | int | i | ) | const
| inline

Test if row is eligible for preprocessing.

Definition at line 1346 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::rowProhibited2 | ( | int | i | ) | const
| inline

Test if row is eligible for preprocessing.

The difference between this method and rowProhibited() is that this method first tests anyProhibited_ before examining the specific entry for the specified row.

Definition at line 1355 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setRowProhibited | ( | int | i | ) |
| inline

Mark row as ineligible for preprocessing.

Definition at line 1362 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::rowUsed | ( | int | i | ) | const
| inline

Test if row is marked as used.

This is for doing faster lookups to see where two rows have entries in common. It can be used anywhere as long as it ends up zeroed out.

Definition at line 1370 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setRowUsed | ( | int | i | ) |
| inline

Mark row as used.

Definition at line 1374 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::unsetRowUsed | ( | int | i | ) |
| inline

Mark row as unused.

Definition at line 1378 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::anyProhibited | ( |  | ) | const
| inline

Check if there are any prohibited rows or columns.

Definition at line 1384 of file CoinPresolveMatrix.hpp.

void CoinPresolveMatrix::setAnyProhibited | ( | bool | val = `true` | ) |
| inline

Set a flag for presence of prohibited rows or columns.

Definition at line 1387 of file CoinPresolveMatrix.hpp.

## Friends And Related Function Documentation

void assignPresolveToPostsolve | ( | CoinPresolveMatrix *& | preObj | ) |
| friend

Initialize a CoinPostsolveMatrix object, destroying the CoinPresolveMatrix object.

See CoinPostsolveMatrix::assignPresolveToPostsolve.

## Member Data Documentation

presolvehlink* CoinPresolveMatrix::clink_

Linked list for the column-major representation.

Definition at line 996 of file CoinPresolveMatrix.hpp.

presolvehlink* CoinPresolveMatrix::rlink_

Linked list for the row-major representation.

Definition at line 998 of file CoinPresolveMatrix.hpp.

double CoinPresolveMatrix::dobias_

Objective function offset introduced during presolve.

Definition at line 1002 of file CoinPresolveMatrix.hpp.

CoinBigIndex* CoinPresolveMatrix::mrstrt_

Vector of row start positions in #hcol, rowels_.

Definition at line 1025 of file CoinPresolveMatrix.hpp.

int* CoinPresolveMatrix::hinrow_

Vector of row lengths.

Definition at line 1027 of file CoinPresolveMatrix.hpp.

double* CoinPresolveMatrix::rowels_

Coefficients (positional correspondence with hcol_)

Definition at line 1029 of file CoinPresolveMatrix.hpp.

int* CoinPresolveMatrix::hcol_

Column indices (positional correspondence with rowels_)

Definition at line 1031 of file CoinPresolveMatrix.hpp.

unsigned char* CoinPresolveMatrix::integerType_

Tracks integrality of columns (1 for integer, 0 for continuous)

Definition at line 1035 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::anyInteger_

Flag to say if any variables are integer.

Note that this flag is not manipulated by the various `setVariableType` routines.

Definition at line 1041 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::tuning_

Print statistics for tuning.

Definition at line 1043 of file CoinPresolveMatrix.hpp.

double CoinPresolveMatrix::startTime_

Start time of presolve.

Definition at line 1047 of file CoinPresolveMatrix.hpp.

double CoinPresolveMatrix::feasibilityTolerance_

Bounds can be moved by this to retain feasibility.

Definition at line 1050 of file CoinPresolveMatrix.hpp.

int CoinPresolveMatrix::status_

Output status: 0 = feasible, 1 = infeasible, 2 = unbounded.

Actually implemented as single bit flags: 1^0 = infeasible, 1^1 = unbounded.

Definition at line 1063 of file CoinPresolveMatrix.hpp.

int CoinPresolveMatrix::pass_

Presolve pass number.

Should be incremented externally by the method controlling application of presolve transforms. Used to control the execution of testRedundant (evoked by the implied_free transform).

Definition at line 1078 of file CoinPresolveMatrix.hpp.

int CoinPresolveMatrix::maxSubstLevel_

Maximum substitution level.

Used to control the execution of subst from implied_free

Definition at line 1087 of file CoinPresolveMatrix.hpp.

unsigned char* CoinPresolveMatrix::colChanged_

Column change status information.

Coded using the following bits:

- 0x01: Column has changed
- 0x02: preprocessing prohibited
- 0x04: Column has been used
- 0x08: Column originally had infinite ub

Definition at line 1116 of file CoinPresolveMatrix.hpp.

int* CoinPresolveMatrix::colsToDo_

Input list of columns to process.

Definition at line 1118 of file CoinPresolveMatrix.hpp.

int CoinPresolveMatrix::numberColsToDo_

Length of colsToDo_.

Definition at line 1120 of file CoinPresolveMatrix.hpp.

int* CoinPresolveMatrix::nextColsToDo_

Output list of columns to process next.

Definition at line 1122 of file CoinPresolveMatrix.hpp.

int CoinPresolveMatrix::numberNextColsToDo_

Length of nextColsToDo_.

Definition at line 1124 of file CoinPresolveMatrix.hpp.

unsigned char* CoinPresolveMatrix::rowChanged_

Row change status information.

Coded using the following bits:

- 0x01: Row has changed
- 0x02: preprocessing prohibited
- 0x04: Row has been used

Definition at line 1135 of file CoinPresolveMatrix.hpp.

int* CoinPresolveMatrix::rowsToDo_

Input list of rows to process.

Definition at line 1137 of file CoinPresolveMatrix.hpp.

int CoinPresolveMatrix::numberRowsToDo_

Length of rowsToDo_.

Definition at line 1139 of file CoinPresolveMatrix.hpp.

int* CoinPresolveMatrix::nextRowsToDo_

Output list of rows to process next.

Definition at line 1141 of file CoinPresolveMatrix.hpp.

int CoinPresolveMatrix::numberNextRowsToDo_

Length of nextRowsToDo_.

Definition at line 1143 of file CoinPresolveMatrix.hpp.

int CoinPresolveMatrix::presolveOptions_

Fine control over presolve actions.

Set/clear the following bits to allow or suppress actions:

- 0x01 allow duplicate column tests for integer variables
- 0x02 not used
- 0x04 set to inhibit x+y+z=1 mods
- 0x08 not used
- 0x10 set to allow stuff which won't unroll easily (overlapping duplicate rows; opportunistic fixing of variables from bound propagation).
- 0x04000 allow presolve transforms to arbitrarily ignore infeasibility and set arbitrary feasible bounds.
- 0x10000 instructs implied_free_action to be `more lightweight'; will return without doing anything after 15 presolve passes.
- 0x(2,4,6)0000 instructs implied_free_action to remove small created elements
- 0x80000000 set by presolve to say dupcol_action compressed columns

Definition at line 1161 of file CoinPresolveMatrix.hpp.

bool CoinPresolveMatrix::anyProhibited_

Flag to say if any rows or columns are marked as prohibited.

Note that this flag is not manipulated by any of the various `set*Prohibited` routines.

Definition at line 1167 of file CoinPresolveMatrix.hpp.

int* CoinPresolveMatrix::usefulRowInt_

Preallocated scratch work array, 3*nrows_.

Definition at line 1181 of file CoinPresolveMatrix.hpp.

double* CoinPresolveMatrix::usefulRowDouble_

Preallocated scratch work array, 2*nrows_.

Definition at line 1183 of file CoinPresolveMatrix.hpp.

int* CoinPresolveMatrix::usefulColumnInt_

Preallocated scratch work array, 2*ncols_.

Definition at line 1185 of file CoinPresolveMatrix.hpp.

double* CoinPresolveMatrix::usefulColumnDouble_

Preallocated scratch work array, ncols_.

Definition at line 1187 of file CoinPresolveMatrix.hpp.

double* CoinPresolveMatrix::randomNumber_

Array of random numbers (max row,column)

Definition at line 1189 of file CoinPresolveMatrix.hpp.

int* CoinPresolveMatrix::infiniteUp_

Work array for count of infinite contributions to row lhs upper bound.

Definition at line 1192 of file CoinPresolveMatrix.hpp.

double* CoinPresolveMatrix::sumUp_

Work array for sum of finite contributions to row lhs upper bound.

Definition at line 1194 of file CoinPresolveMatrix.hpp.

int* CoinPresolveMatrix::infiniteDown_

Work array for count of infinite contributions to row lhs lower bound.

Definition at line 1196 of file CoinPresolveMatrix.hpp.

double* CoinPresolveMatrix::sumDown_

Work array for sum of finite contributions to row lhs lower bound.

Definition at line 1198 of file CoinPresolveMatrix.hpp.

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

- /tmp/Osi-0.107.7/CoinUtils/src/CoinPresolveMatrix.hpp
- /tmp/Osi-0.107.7/CoinUtils/src/CoinPresolvePsdebug.hpp