# CoinPostsolveMatrix Class Reference

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

`#include <CoinPresolveMatrix.hpp>`

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

List of all members.

## Public Member Functions
| CoinPostsolveMatrix (int ncols_alloc, int nrows_alloc, CoinBigIndex nelems_alloc)
| `Native' constructor
| CoinPostsolveMatrix (ClpSimplex *si, int ncols0, int nrows0, CoinBigIndex nelems0, double maxmin_, double *sol, double *acts, unsigned char *colstat, unsigned char *rowstat)
| Clp OSI constructor.
| CoinPostsolveMatrix (OsiSolverInterface *si, int ncols0, int nrows0, CoinBigIndex nelems0, double maxmin_, double *sol, double *acts, unsigned char *colstat, unsigned char *rowstat)
| Generic OSI constructor.
void | assignPresolveToPostsolve (CoinPresolveMatrix *&preObj)
| Load an empty CoinPostsolveMatrix from a CoinPresolveMatrix.
| ~CoinPostsolveMatrix ()
| Destructor.
void | check_nbasic ()
| debug
## Public Attributes
Column thread structures
As mentioned in the class documentation, the entries for a given column do not necessarily occupy a contiguous block of space. The link_ array is used to maintain the threading. There is one thread for each column, and a single thread for all free entries in hrow_ and colels_. The allocated size of link_ must be at least as large as the allocated size of hrow_ and colels_.
CoinBigIndex | free_list_
| First entry in free entries thread.
int | maxlink_
| Allocated size of link_.
CoinBigIndex * | link_
| Thread array.
Debugging aids
These arrays are allocated only when CoinPresolve is compiled with PRESOLVE_DEBUG defined. They hold codes which track the reason that a column or row is added to the problem during postsolve.
char * | cdone_
char * | rdone_
## Related Functions
(Note that these are not member functions.)
CoinBigIndex | presolve_find_col (int col, CoinBigIndex krs, CoinBigIndex kre, const int *hcol)
| Find position of a column in a row in a row-major matrix.
CoinBigIndex | presolve_find_minor2 (int tgt, CoinBigIndex ks, int majlen, const int *minndxs, const CoinBigIndex *majlinks)
| Find position of a minor index in a major vector in a threaded matrix.
CoinBigIndex | presolve_find_row2 (int row, CoinBigIndex kcs, int collen, const int *hrow, const CoinBigIndex *clinks)
| Find position of a row in a column in a column-major threaded matrix.
CoinBigIndex | presolve_find_minor3 (int tgt, CoinBigIndex ks, int majlen, const int *minndxs, const CoinBigIndex *majlinks)
| Find position of a minor index in a major vector in a threaded matrix.
CoinBigIndex | presolve_find_row3 (int row, CoinBigIndex kcs, int collen, const int *hrow, const CoinBigIndex *clinks)
| Find position of a row in a column in a column-major threaded matrix.
void | presolve_delete_from_major2 (int majndx, int minndx, CoinBigIndex *majstrts, int *majlens, int *minndxs, int *majlinks, CoinBigIndex *free_listp)
| Delete the entry for a minor index from a major vector in a threaded matrix.
void | presolve_delete_from_col2 (int row, int col, CoinBigIndex *mcstrt, int *hincol, int *hrow, int *clinks, CoinBigIndex *free_listp)
| Delete the entry for row `row` from column `col` in a column-major threaded matrix.
void | presolve_check_threads (const CoinPostsolveMatrix *obj)
| Checks that column threads agree with column lengths.
void | presolve_check_free_list (const CoinPostsolveMatrix *obj, bool chkElemCnt=false)
| Checks the free list.
void | presolve_check_reduced_costs (const CoinPostsolveMatrix *obj)
| Check stored reduced costs for accuracy and consistency with variable status.
void | presolve_check_duals (const CoinPostsolveMatrix *postObj)
| Check the dual variables for consistency with row activity.

## Detailed Description

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

The notable point is that the matrix representation is threaded. The representation is column-major and starts with the standard two pairs of arrays: one pair to hold the row indices and coefficients, the second pair to hold the column starting positions and lengths. But the row indices and coefficients for a column do not necessarily occupy a contiguous block in their respective arrays. Instead, a link array gives the position of the next (row index,coefficient) pair. If the row index and value of a coefficient a<p,j> occupy position kp in their arrays, then the position of the next coefficient a<q,j> is found as kq = link[kp].

This threaded representation allows for efficient expansion of columns as rows are reintroduced during postsolve transformations. The basic packed structures are allocated to the expected size of the postsolved matrix, and as new coefficients are added, their location is simply added to the thread for the column.

There is no provision to convert the threaded representation to a packed representation. In the context of postsolve, it's not required. (You did keep a copy of the original matrix, eh?)

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 1421 of file CoinPresolveMatrix.hpp.

## Constructor & Destructor Documentation

CoinPostsolveMatrix::CoinPostsolveMatrix | ( | 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.

CoinPostsolveMatrix::CoinPostsolveMatrix | ( | ClpSimplex * | si,
|  | int | ncols0,
|  | int | nrows0,
|  | CoinBigIndex | nelems0,
|  | double | maxmin_,
|  | double * | sol,
|  | double * | acts,
|  | unsigned char * | colstat,
|  | unsigned char * | rowstat |
| ) |  |  |

Clp OSI constructor.

See Clp code for the definition.

CoinPostsolveMatrix::CoinPostsolveMatrix | ( | OsiSolverInterface * | si,
|  | int | ncols0,
|  | int | nrows0,
|  | CoinBigIndex | nelems0,
|  | double | maxmin_,
|  | double * | sol,
|  | double * | acts,
|  | unsigned char * | colstat,
|  | unsigned char * | rowstat |
| ) |  |  |

Generic OSI constructor.

See OSI code for the definition.

CoinPostsolveMatrix::~CoinPostsolveMatrix | ( |  | ) |

Destructor.

## Member Function Documentation

void CoinPostsolveMatrix::assignPresolveToPostsolve | ( | CoinPresolveMatrix *& | preObj | ) |

Load an empty CoinPostsolveMatrix from a CoinPresolveMatrix.

This routine transfers the contents of the CoinPrePostsolveMatrix object from the CoinPresolveMatrix object to the CoinPostsolveMatrix object and completes initialisation of the CoinPostsolveMatrix object. The empty shell of the CoinPresolveMatrix object is destroyed.

The routine expects an empty CoinPostsolveMatrix object. If handed a loaded object, a lot of memory will leak.

void CoinPostsolveMatrix::check_nbasic | ( |  | ) |

debug

## Member Data Documentation

CoinBigIndex CoinPostsolveMatrix::free_list_

First entry in free entries thread.

Definition at line 1501 of file CoinPresolveMatrix.hpp.

int CoinPostsolveMatrix::maxlink_

Allocated size of link_.

Definition at line 1503 of file CoinPresolveMatrix.hpp.

CoinBigIndex* CoinPostsolveMatrix::link_

Thread array.

Within a thread, link_[k] points to the next entry in the thread.

Definition at line 1508 of file CoinPresolveMatrix.hpp.

char* CoinPostsolveMatrix::cdone_

Definition at line 1519 of file CoinPresolveMatrix.hpp.

char* CoinPostsolveMatrix::rdone_

Definition at line 1520 of file CoinPresolveMatrix.hpp.

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

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