#include <CoinDenseFactorization.hpp>
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) |
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.
CoinDenseFactorization::CoinDenseFactorization | ( | ) |
Default constructor.
CoinDenseFactorization::CoinDenseFactorization | ( | const CoinDenseFactorization & | other | ) |
Copy constructor.
CoinDenseFactorization::~CoinDenseFactorization | ( | ) |
Destructor.
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_.
Referenced by ClpFactorization::status().
void CoinDenseFactorization::setStatus | ( | int | value | ) | [inline] |
Sets status.
Definition at line 75 of file CoinDenseFactorization.hpp.
References status_.
Referenced by ClpFactorization::setStatus().
int CoinDenseFactorization::pivots | ( | ) | const [inline] |
Returns number of pivots since factorization.
Definition at line 78 of file CoinDenseFactorization.hpp.
References numberPivots_.
Referenced by ClpFactorization::pivots().
int CoinDenseFactorization::numberRows | ( | ) | const [inline] |
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_.
Referenced by ClpFactorization::numberElements().
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] |
int CoinDenseFactorization::maximumPivots | ( | ) | const [inline] |
Maximum number of pivots between factorizations.
Definition at line 103 of file CoinDenseFactorization.hpp.
References maximumPivots_.
Referenced by ClpFactorization::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_.
Referenced by ClpFactorization::zeroTolerance().
void CoinDenseFactorization::zeroTolerance | ( | double | value | ) | [inline] |
Returns status.
Definition at line 117 of file CoinDenseFactorization.hpp.
References zeroTolerance_.
double CoinDenseFactorization::slackValue | ( | ) | const [inline] |
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 155 of file CoinDenseFactorization.hpp.
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.
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] |
double* CoinDenseFactorization::elements | ( | ) | const [inline] |
int* CoinDenseFactorization::indices | ( | ) | const [inline] |
CoinBigIndex* CoinDenseFactorization::starts | ( | ) | const [inline] |
int* CoinDenseFactorization::pivotRow | ( | ) | const [inline] |
int* CoinDenseFactorization::permute | ( | ) | const [inline] |
Returns permute in.
Definition at line 191 of file CoinDenseFactorization.hpp.
Referenced by ClpFactorization::permute(), and ClpFactorization::pivotColumn().
int* CoinDenseFactorization::permuteBack | ( | ) | const [inline] |
double* CoinDenseFactorization::workArea | ( | ) | const [inline] |
int* CoinDenseFactorization::intWorkArea | ( | ) | const [inline] |
void CoinDenseFactorization::gutsOfDestructor | ( | ) |
The real work of desstructor.
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.
void CoinDenseFactorizationUnitTest | ( | const std::string & | mpsDir | ) | [friend] |
double CoinDenseFactorization::pivotTolerance_ [protected] |
Pivot tolerance.
Definition at line 222 of file CoinDenseFactorization.hpp.
Referenced by pivotTolerance().
double CoinDenseFactorization::zeroTolerance_ [protected] |
Zero tolerance.
Definition at line 224 of file CoinDenseFactorization.hpp.
Referenced by zeroTolerance().
double CoinDenseFactorization::slackValue_ [protected] |
double CoinDenseFactorization::relaxCheck_ [protected] |
Relax check on accuracy in replaceColumn.
Definition at line 234 of file CoinDenseFactorization.hpp.
Referenced by getAccuracyCheck(), and relaxAccuracyCheck().
int CoinDenseFactorization::numberRows_ [protected] |
Number of Rows in factorization.
Definition at line 236 of file CoinDenseFactorization.hpp.
Referenced by numberElements(), and numberRows().
int CoinDenseFactorization::numberColumns_ [protected] |
Number of Columns in factorization.
Definition at line 238 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 240 of file CoinDenseFactorization.hpp.
CoinBigIndex CoinDenseFactorization::maximumSpace_ [protected] |
int CoinDenseFactorization::numberGoodU_ [protected] |
Number factorized in U (not row singletons).
Definition at line 244 of file CoinDenseFactorization.hpp.
Referenced by numberGoodColumns().
int CoinDenseFactorization::maximumPivots_ [protected] |
Maximum number of pivots before factorization.
Definition at line 246 of file CoinDenseFactorization.hpp.
Referenced by maximumPivots().
int CoinDenseFactorization::numberPivots_ [protected] |
Number pivots since last factorization.
Definition at line 248 of file CoinDenseFactorization.hpp.
Referenced by numberElements(), and pivots().
CoinBigIndex CoinDenseFactorization::factorElements_ [protected] |
int* CoinDenseFactorization::pivotRow_ [protected] |
int CoinDenseFactorization::status_ [protected] |
Status of factorization.
Definition at line 254 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 259 of file CoinDenseFactorization.hpp.
double* CoinDenseFactorization::workArea_ [protected] |