# CoinPresolveMonitor Class Reference

Monitor a row or column for modification. More...

`#include <CoinPresolveMonitor.hpp>`

Collaboration diagram for CoinPresolveMonitor:
[legend]

List of all members.

## Public Member Functions
| CoinPresolveMonitor ()
| Default constructor.
| CoinPresolveMonitor (const CoinPresolveMatrix *mtx, bool isRow, int k)
| Initialise from a CoinPresolveMatrix.
| CoinPresolveMonitor (const CoinPostsolveMatrix *mtx, bool isRow, int k)
| Initialise from a CoinPostsolveMatrix.
void | checkAndTell (const CoinPresolveMatrix *mtx)
| Compare the present row or column against the stored copy and report differences.
void | checkAndTell (const CoinPostsolveMatrix *mtx)
| Compare the present row or column against the stored copy and report differences.
## Private Member Functions
CoinPackedVector * | extractRow (int i, const CoinPresolveMatrix *mtx) const
| Extract a row from a CoinPresolveMatrix.
CoinPackedVector * | extractCol (int j, const CoinPresolveMatrix *mtx) const
| Extract a column from a CoinPresolveMatrix.
CoinPackedVector * | extractRow (int i, const CoinPostsolveMatrix *mtx) const
| Extract a row from a CoinPostsolveMatrix.
CoinPackedVector * | extractCol (int j, const CoinPostsolveMatrix *mtx) const
| Extract a column from a CoinPostsolveMatrix.
void | checkAndTell (CoinPackedVector *curVec, double lb, double ub)
| Worker method underlying the public checkAndTell methods.
## Private Attributes
bool | isRow_
| True to monitor a row, false to monitor a column.
int | ndx_
| Row or column index.
CoinPackedVector * | origVec_
double | lb_
| Original row or column lower bound.
double | ub_
| Original row or column upper bound.

## Detailed Description

Monitor a row or column for modification.

The purpose of this class is to monitor a row or column for modifications during presolve and postsolve. Each object can monitor one row or column. The initial copy of the row or column is loaded by the constructor. Each subsequent call to checkAndTell() compares the current state of the row or column with the stored state and reports any modifications.

Internally the row or column is held as a CoinPackedVector so that it's possible to follow a row or column through presolve (CoinPresolveMatrix) and postsolve (CoinPostsolveMatrix).

Do not underestimate the amount of work required here. Extracting a row from the CoinPostsolve matrix requires a scan of every element in the matrix. That's one scan by the constructor and one scan with every call to modify. But that's precisely why it's virtually impossible to debug presolve without aids.

Parameter overloads for CoinPresolveMatrix and CoinPostsolveMatrix are a little clumsy, but not a problem in use. The alternative is to add methods to the CoinPresolveMatrix and CoinPostsolveMatrix classes that will only be used for debugging. That's not too attractive either.

Definition at line 29 of file CoinPresolveMonitor.hpp.

## Constructor & Destructor Documentation

CoinPresolveMonitor::CoinPresolveMonitor | ( |  | ) |

Default constructor.

Creates an empty monitor.

CoinPresolveMonitor::CoinPresolveMonitor | ( | const CoinPresolveMatrix * | mtx,
|  | bool | isRow,
|  | int | k |
| ) |  |  |

Initialise from a CoinPresolveMatrix.

Load the initial row or column from a CoinPresolveMatrix. Set `isRow` true for a row, false for a column.

CoinPresolveMonitor::CoinPresolveMonitor | ( | const CoinPostsolveMatrix * | mtx,
|  | bool | isRow,
|  | int | k |
| ) |  |  |

Initialise from a CoinPostsolveMatrix.

Load the initial row or column from a CoinPostsolveMatrix. Set `isRow` true for a row, false for a column.

## Member Function Documentation

void CoinPresolveMonitor::checkAndTell | ( | const CoinPresolveMatrix * | mtx | ) |

Compare the present row or column against the stored copy and report differences.

Load the current row or column from a CoinPresolveMatrix and compare. Differences are printed to std::cout.

void CoinPresolveMonitor::checkAndTell | ( | const CoinPostsolveMatrix * | mtx | ) |

Compare the present row or column against the stored copy and report differences.

Load the current row or column from a CoinPostsolveMatrix and compare. Differences are printed to std::cout.

CoinPackedVector* CoinPresolveMonitor::extractRow | ( | int | i,
|  | const CoinPresolveMatrix * | mtx |
| ) |  |  | const`[private]`

Extract a row from a CoinPresolveMatrix.

CoinPackedVector* CoinPresolveMonitor::extractCol | ( | int | j,
|  | const CoinPresolveMatrix * | mtx |
| ) |  |  | const`[private]`

Extract a column from a CoinPresolveMatrix.

CoinPackedVector* CoinPresolveMonitor::extractRow | ( | int | i,
|  | const CoinPostsolveMatrix * | mtx |
| ) |  |  | const`[private]`

Extract a row from a CoinPostsolveMatrix.

CoinPackedVector* CoinPresolveMonitor::extractCol | ( | int | j,
|  | const CoinPostsolveMatrix * | mtx |
| ) |  |  | const`[private]`

Extract a column from a CoinPostsolveMatrix.

void CoinPresolveMonitor::checkAndTell | ( | CoinPackedVector * | curVec,
|  | double | lb,
|  | double | ub |
| ) |  |  | `[private]`

Worker method underlying the public checkAndTell methods.

## Member Data Documentation

bool CoinPresolveMonitor::isRow_`[private]`

True to monitor a row, false to monitor a column.

Definition at line 87 of file CoinPresolveMonitor.hpp.

int CoinPresolveMonitor::ndx_`[private]`

Row or column index.

Definition at line 90 of file CoinPresolveMonitor.hpp.

CoinPackedVector* CoinPresolveMonitor::origVec_`[private]`

The original row or column

Sorted in increasing order of indices.

Definition at line 96 of file CoinPresolveMonitor.hpp.

double CoinPresolveMonitor::lb_`[private]`

Original row or column lower bound.

Definition at line 99 of file CoinPresolveMonitor.hpp.

double CoinPresolveMonitor::ub_`[private]`

Original row or column upper bound.

Definition at line 102 of file CoinPresolveMonitor.hpp.

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

- /home/coin/svn-release/Alps-1.4.5/CoinUtils/src/CoinPresolveMonitor.hpp