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

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# CoinDenseFactorization Class Reference

This deals with Factorization and Updates This is a simple dense version so other people can write a better one. More...

`#include <CoinDenseFactorization.hpp>`

List of all members.

## Public Member Functions
void | gutsOfDestructor ()
| The real work of desstructor.
void | gutsOfInitialize ()
| The real work of constructor.
void | gutsOfCopy (const CoinDenseFactorization &other)
| The real work of copy.
Constructors and destructor and copy
| CoinDenseFactorization ()
| Default constructor.
| CoinDenseFactorization (const CoinDenseFactorization &other)
| Copy constructor.
| ~CoinDenseFactorization ()
| Destructor.
CoinDenseFactorization & | operator= (const CoinDenseFactorization &other)
| = copy
Do factorization - public
void | getAreas (int numberRows, int numberColumns, CoinBigIndex maximumL, CoinBigIndex maximumU)
| Gets space for a factorization.
void | preProcess ()
| PreProcesses column ordered copy of basis.
int | factor ()
| Does most of factorization returning status 0 - OK -99 - needs more memory -1 - singular - use numberGoodColumns and redo.
void | postProcess (const int *sequence, int *pivotVariable)
| Does post processing on valid factorization - putting variables on correct rows.
void | makeNonSingular (int *sequence, int numberColumns)
| Makes a non-singular basis by replacing variables.
general stuff such as status
int | status () const
| Returns status.
void | setStatus (int value)
| Sets status.
int | pivots () const
| Returns number of pivots since factorization.
int | numberRows () const
| Number of Rows.
int | numberColumns () const
| Total number of columns in factorization.
int | numberElements () const
| Total number of elements in factorization.
int | numberGoodColumns () const
| Number of good columns in factorization.
void | relaxAccuracyCheck (double value)
| Allows change of pivot accuracy check 1.0 == none >1.0 relaxed.
double | getAccuracyCheck () const
| Returns status.
int | maximumPivots () const
| Maximum number of pivots between factorizations.
void | maximumPivots (int value)
| Returns status.
double | pivotTolerance () const
| Pivot tolerance.
void | pivotTolerance (double value)
| Returns status.
double | zeroTolerance () const
| Zero tolerance.
void | zeroTolerance (double value)
| Returns status.
double | slackValue () const
| Whether slack value is +1 or -1.
void | slackValue (double value)
| Returns status.
double | maximumCoefficient () const
| Returns maximum absolute value in factorization.
rank one updates which do exist
int | replaceColumn (CoinIndexedVector *regionSparse, int pivotRow, double pivotCheck, bool checkBeforeModifying=false)
| Replaces one Column to basis, returns 0=OK, 1=Probably OK, 2=singular, 3=no room If checkBeforeModifying is true will do all accuracy checks before modifying factorization.
various uses of factorization (return code number elements)
which user may want to know about
int | updateColumnFT (CoinIndexedVector *regionSparse, CoinIndexedVector *regionSparse2)
| Updates one column (FTRAN) from regionSparse2 Tries to do FT update number returned is negative if no room regionSparse starts as zero and is zero at end.
int | updateColumn (CoinIndexedVector *regionSparse, CoinIndexedVector *regionSparse2, bool noPermute=false) const
| This version has same effect as above with FTUpdate==false so number returned is always >=0.
int | updateColumnTranspose (CoinIndexedVector *regionSparse, CoinIndexedVector *regionSparse2) const
| Updates one column (BTRAN) from regionSparse2 regionSparse starts as zero and is zero at end Note - if regionSparse2 packed on input - will be packed on output.
various uses of factorization
which user may not want to know about (left over from my LP code)
void | clearArrays ()
| Get rid of all memory.
double * | elements () const
| Returns array to put basis elements in.
int * | indices () const
| Returns array to put basis indices in.
CoinBigIndex * | starts () const
| Returns array to put basis starts in.
int * | pivotRow () const
| Returns pivot row.
int * | permute () const
| Returns permute in.
int * | permuteBack () const
| Returns permute back.
double * | workArea () const
| Returns work area.
int * | intWorkArea () const
| Returns int work area.
## Protected Member Functions
int | checkPivot (double saveFromU, double oldPivot) const
| Returns accuracy status of replaceColumn returns 0=OK, 1=Probably OK, 2=singular.
## Protected Attributes
data
double | pivotTolerance_
| Pivot tolerance.
double | zeroTolerance_
| Zero tolerance.
double | slackValue_
| Whether slack value is +1 or -1.
double | relaxCheck_
| Relax check on accuracy in replaceColumn.
int | numberRows_
| Number of Rows in factorization.
int | numberColumns_
| Number of Columns in factorization.
int | maximumRows_
| Maximum rows ever (i.e. use to copy arrays etc).
CoinBigIndex | maximumSpace_
| Maximum length of iterating area.
int | numberGoodU_
| Number factorized in U (not row singletons).
int | maximumPivots_
| Maximum number of pivots before factorization.
int | numberPivots_
| Number pivots since last factorization.
CoinBigIndex | factorElements_
| Number of elements after factorization.
int * | pivotRow_
| Pivot row.
int | status_
| Status of factorization.
double * | elements_
| Elements of factorization and updates length is maxR*maxR+maxSpace will always be long enough so can have nR*nR ints in maxSpace.
double * | workArea_
| Work area of numberRows_.
## Friends
void | CoinDenseFactorizationUnitTest (const std::string &mpsDir)

## Detailed Description

This deals with Factorization and Updates This is a simple dense version so other people can write a better one.

I am assuming that 32 bits is enough for number of rows or columns, but CoinBigIndex may be redefined to get 64 bits.

Definition at line 28 of file CoinDenseFactorization.hpp.

## Constructor & Destructor Documentation

CoinDenseFactorization::CoinDenseFactorization | ( |  | ) |

Default constructor.

CoinDenseFactorization::CoinDenseFactorization | ( | const CoinDenseFactorization & | other | ) |

Copy constructor.

CoinDenseFactorization::~CoinDenseFactorization | ( |  | ) |

Destructor.

## Member Function Documentation

CoinDenseFactorization& CoinDenseFactorization::operator= | ( | const CoinDenseFactorization & | other | ) |

= copy

void CoinDenseFactorization::getAreas | ( | int | numberRows,
|  | int | numberColumns,
|  | CoinBigIndex | maximumL,
|  | CoinBigIndex | maximumU |
| ) |  |  |

Gets space for a factorization.

void CoinDenseFactorization::preProcess | ( |  | ) |

PreProcesses column ordered copy of basis.

int CoinDenseFactorization::factor | ( |  | ) |

Does most of factorization returning status 0 - OK -99 - needs more memory -1 - singular - use numberGoodColumns and redo.

void CoinDenseFactorization::postProcess | ( | const int * | sequence,
|  | int * | pivotVariable |
| ) |  |  |

Does post processing on valid factorization - putting variables on correct rows.

void CoinDenseFactorization::makeNonSingular | ( | int * | sequence,
|  | int | numberColumns |
| ) |  |  |

Makes a non-singular basis by replacing variables.

int CoinDenseFactorization::status | ( |  | ) | const`[inline]`

Returns status.

Definition at line 71 of file CoinDenseFactorization.hpp.

References status_.

void CoinDenseFactorization::setStatus | ( | int | value | ) | `[inline]`

Sets status.

Definition at line 75 of file CoinDenseFactorization.hpp.

References status_.

int CoinDenseFactorization::pivots | ( |  | ) | const`[inline]`

Returns number of pivots since factorization.

Definition at line 78 of file CoinDenseFactorization.hpp.

References numberPivots_.

int CoinDenseFactorization::numberRows | ( |  | ) | const`[inline]`

Number of Rows.

Definition at line 82 of file CoinDenseFactorization.hpp.

References numberRows_.

int CoinDenseFactorization::numberColumns | ( |  | ) | const`[inline]`

Total number of columns in factorization.

Definition at line 86 of file CoinDenseFactorization.hpp.

References numberColumns_.

int CoinDenseFactorization::numberElements | ( |  | ) | const`[inline]`

Total number of elements in factorization.

Definition at line 90 of file CoinDenseFactorization.hpp.

References numberColumns_, numberPivots_, and numberRows_.

int CoinDenseFactorization::numberGoodColumns | ( |  | ) | const`[inline]`

Number of good columns in factorization.

Definition at line 94 of file CoinDenseFactorization.hpp.

References numberGoodU_.

void CoinDenseFactorization::relaxAccuracyCheck | ( | double | value | ) | `[inline]`

Allows change of pivot accuracy check 1.0 == none >1.0 relaxed.

Definition at line 98 of file CoinDenseFactorization.hpp.

References relaxCheck_.

double CoinDenseFactorization::getAccuracyCheck | ( |  | ) | const`[inline]`

Returns status.

Definition at line 100 of file CoinDenseFactorization.hpp.

References relaxCheck_.

int CoinDenseFactorization::maximumPivots | ( |  | ) | const`[inline]`

Maximum number of pivots between factorizations.

Definition at line 103 of file CoinDenseFactorization.hpp.

References maximumPivots_.

void CoinDenseFactorization::maximumPivots | ( | int | value | ) |

Returns status.

double CoinDenseFactorization::pivotTolerance | ( |  | ) | const`[inline]`

Pivot tolerance.

Definition at line 109 of file CoinDenseFactorization.hpp.

References pivotTolerance_.

void CoinDenseFactorization::pivotTolerance | ( | double | value | ) |

Returns status.

double CoinDenseFactorization::zeroTolerance | ( |  | ) | const`[inline]`

Zero tolerance.

Definition at line 114 of file CoinDenseFactorization.hpp.

References zeroTolerance_.

void CoinDenseFactorization::zeroTolerance | ( | double | value | ) | `[inline]`

Returns status.

Definition at line 117 of file CoinDenseFactorization.hpp.

References zeroTolerance_.

double CoinDenseFactorization::slackValue | ( |  | ) | const`[inline]`

Whether slack value is +1 or -1.

Definition at line 120 of file CoinDenseFactorization.hpp.

References slackValue_.

void CoinDenseFactorization::slackValue | ( | double | value | ) |

Returns status.

double CoinDenseFactorization::maximumCoefficient | ( |  | ) | const

Returns maximum absolute value in factorization.

int CoinDenseFactorization::replaceColumn | ( | CoinIndexedVector * | regionSparse,
|  | int | pivotRow,
|  | double | pivotCheck,
|  | bool | checkBeforeModifying = `false` |
| ) |  |  |

Replaces one Column to basis, returns 0=OK, 1=Probably OK, 2=singular, 3=no room If checkBeforeModifying is true will do all accuracy checks before modifying factorization.

Whether to set this depends on speed considerations. You could just do this on first iteration after factorization and thereafter re-factorize partial update already in U

int CoinDenseFactorization::updateColumnFT | ( | CoinIndexedVector * | regionSparse,
|  | CoinIndexedVector * | regionSparse2 |
| ) |  |  | `[inline]`

Updates one column (FTRAN) from regionSparse2 Tries to do FT update number returned is negative if no room regionSparse starts as zero and is zero at end.

Note - if regionSparse2 packed on input - will be packed on output

Definition at line 153 of file CoinDenseFactorization.hpp.

References updateColumn().

int CoinDenseFactorization::updateColumn | ( | CoinIndexedVector * | regionSparse,
|  | CoinIndexedVector * | regionSparse2,
|  | bool | noPermute = `false` |
| ) |  |  | const

This version has same effect as above with FTUpdate==false so number returned is always >=0.

Referenced by updateColumnFT().

int CoinDenseFactorization::updateColumnTranspose | ( | CoinIndexedVector * | regionSparse,
|  | CoinIndexedVector * | regionSparse2 |
| ) |  |  | const

Updates one column (BTRAN) from regionSparse2 regionSparse starts as zero and is zero at end Note - if regionSparse2 packed on input - will be packed on output.

void CoinDenseFactorization::clearArrays | ( |  | ) | `[inline]`

Get rid of all memory.

Definition at line 174 of file CoinDenseFactorization.hpp.

References gutsOfDestructor().

double* CoinDenseFactorization::elements | ( |  | ) | const`[inline]`

Returns array to put basis elements in.

Definition at line 177 of file CoinDenseFactorization.hpp.

References elements_.

int* CoinDenseFactorization::indices | ( |  | ) | const`[inline]`

Returns array to put basis indices in.

Definition at line 180 of file CoinDenseFactorization.hpp.

References elements_, and numberRows_.

CoinBigIndex* CoinDenseFactorization::starts | ( |  | ) | const`[inline]`

Returns array to put basis starts in.

Definition at line 183 of file CoinDenseFactorization.hpp.

References pivotRow_.

int* CoinDenseFactorization::pivotRow | ( |  | ) | const`[inline]`

Returns pivot row.

Definition at line 186 of file CoinDenseFactorization.hpp.

References pivotRow_.

int* CoinDenseFactorization::permute | ( |  | ) | const`[inline]`

Returns permute in.

Definition at line 189 of file CoinDenseFactorization.hpp.

References pivotRow_.

int* CoinDenseFactorization::permuteBack | ( |  | ) | const`[inline]`

Returns permute back.

Definition at line 192 of file CoinDenseFactorization.hpp.

References numberRows_, and pivotRow_.

double* CoinDenseFactorization::workArea | ( |  | ) | const`[inline]`

Returns work area.

Definition at line 195 of file CoinDenseFactorization.hpp.

References workArea_.

int* CoinDenseFactorization::intWorkArea | ( |  | ) | const`[inline]`

Returns int work area.

Definition at line 198 of file CoinDenseFactorization.hpp.

References workArea_.

void CoinDenseFactorization::gutsOfDestructor | ( |  | ) |

The real work of desstructor.

Referenced by clearArrays().

void CoinDenseFactorization::gutsOfInitialize | ( |  | ) |

The real work of constructor.

void CoinDenseFactorization::gutsOfCopy | ( | const CoinDenseFactorization & | other | ) |

The real work of copy.

int CoinDenseFactorization::checkPivot | ( | double | saveFromU,
|  | double | oldPivot |
| ) |  |  | const`[protected]`

Returns accuracy status of replaceColumn returns 0=OK, 1=Probably OK, 2=singular.

## Friends And Related Function Documentation

void CoinDenseFactorizationUnitTest | ( | const std::string & | mpsDir | ) | `[friend]`

## Member Data Documentation

double CoinDenseFactorization::pivotTolerance_`[protected]`

Pivot tolerance.

Definition at line 220 of file CoinDenseFactorization.hpp.

Referenced by pivotTolerance().

double CoinDenseFactorization::zeroTolerance_`[protected]`

Zero tolerance.

Definition at line 222 of file CoinDenseFactorization.hpp.

Referenced by zeroTolerance().

double CoinDenseFactorization::slackValue_`[protected]`

Whether slack value is +1 or -1.

Definition at line 224 of file CoinDenseFactorization.hpp.

Referenced by slackValue().

double CoinDenseFactorization::relaxCheck_`[protected]`

Relax check on accuracy in replaceColumn.

Definition at line 226 of file CoinDenseFactorization.hpp.

Referenced by getAccuracyCheck(), and relaxAccuracyCheck().

int CoinDenseFactorization::numberRows_`[protected]`

Number of Rows in factorization.

Definition at line 228 of file CoinDenseFactorization.hpp.

Referenced by indices(), numberElements(), numberRows(), and permuteBack().

int CoinDenseFactorization::numberColumns_`[protected]`

Number of Columns in factorization.

Definition at line 230 of file CoinDenseFactorization.hpp.

Referenced by numberColumns(), and numberElements().

int CoinDenseFactorization::maximumRows_`[protected]`

Maximum rows ever (i.e. use to copy arrays etc).

Definition at line 232 of file CoinDenseFactorization.hpp.

CoinBigIndex CoinDenseFactorization::maximumSpace_`[protected]`

Maximum length of iterating area.

Definition at line 234 of file CoinDenseFactorization.hpp.

int CoinDenseFactorization::numberGoodU_`[protected]`

Number factorized in U (not row singletons).

Definition at line 236 of file CoinDenseFactorization.hpp.

Referenced by numberGoodColumns().

int CoinDenseFactorization::maximumPivots_`[protected]`

Maximum number of pivots before factorization.

Definition at line 238 of file CoinDenseFactorization.hpp.

Referenced by maximumPivots().

int CoinDenseFactorization::numberPivots_`[protected]`

Number pivots since last factorization.

Definition at line 240 of file CoinDenseFactorization.hpp.

Referenced by numberElements(), and pivots().

CoinBigIndex CoinDenseFactorization::factorElements_`[protected]`

Number of elements after factorization.

Definition at line 242 of file CoinDenseFactorization.hpp.

int* CoinDenseFactorization::pivotRow_`[protected]`

Pivot row.

Definition at line 244 of file CoinDenseFactorization.hpp.

Referenced by permute(), permuteBack(), pivotRow(), and starts().

int CoinDenseFactorization::status_`[protected]`

Status of factorization.

Definition at line 246 of file CoinDenseFactorization.hpp.

Referenced by setStatus(), and status().

double* CoinDenseFactorization::elements_`[protected]`

Elements of factorization and updates length is maxR*maxR+maxSpace will always be long enough so can have nR*nR ints in maxSpace.

Definition at line 251 of file CoinDenseFactorization.hpp.

Referenced by elements(), and indices().

double* CoinDenseFactorization::workArea_`[protected]`

Work area of numberRows_.

Definition at line 253 of file CoinDenseFactorization.hpp.

Referenced by intWorkArea(), and workArea().

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

- /home/coin/SVN-release/Cgl-0.52.0/CoinUtils/src/CoinDenseFactorization.hpp