#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 | |
*** Below this user may not want to know about
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] |
void CoinDenseFactorization::setStatus | ( | int | value | ) | [inline] |
int CoinDenseFactorization::pivots | ( | ) | const [inline] |
Returns number of pivots since factorization.
Definition at line 78 of file CoinDenseFactorization.hpp.
int CoinDenseFactorization::numberRows | ( | ) | const [inline] |
int CoinDenseFactorization::numberColumns | ( | ) | const [inline] |
int CoinDenseFactorization::numberElements | ( | ) | const [inline] |
Total number of elements in factorization.
Definition at line 90 of file CoinDenseFactorization.hpp.
int CoinDenseFactorization::numberGoodColumns | ( | ) | const [inline] |
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.
double CoinDenseFactorization::getAccuracyCheck | ( | ) | const [inline] |
int CoinDenseFactorization::maximumPivots | ( | ) | const [inline] |
Maximum number of pivots between factorizations.
Definition at line 103 of file CoinDenseFactorization.hpp.
void CoinDenseFactorization::maximumPivots | ( | int | value | ) |
Returns status.
double CoinDenseFactorization::pivotTolerance | ( | ) | const [inline] |
void CoinDenseFactorization::pivotTolerance | ( | double | value | ) |
Returns status.
double CoinDenseFactorization::zeroTolerance | ( | ) | const [inline] |
void CoinDenseFactorization::zeroTolerance | ( | double | value | ) | [inline] |
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] |
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] |
double CoinDenseFactorization::zeroTolerance_ [protected] |
double CoinDenseFactorization::slackValue_ [protected] |
double CoinDenseFactorization::relaxCheck_ [protected] |
Relax check on accuracy in replaceColumn.
Definition at line 234 of file CoinDenseFactorization.hpp.
int CoinDenseFactorization::numberRows_ [protected] |
int CoinDenseFactorization::numberColumns_ [protected] |
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.
int CoinDenseFactorization::maximumPivots_ [protected] |
Maximum number of pivots before factorization.
Definition at line 246 of file CoinDenseFactorization.hpp.
int CoinDenseFactorization::numberPivots_ [protected] |
CoinBigIndex CoinDenseFactorization::factorElements_ [protected] |
int* CoinDenseFactorization::pivotRow_ [protected] |
int CoinDenseFactorization::status_ [protected] |
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] |