This deals with Factorization and Updates This is a simple dense version so other people can write a better one. More...
#include <CoinDenseFactorization.hpp>
Public Member Functions | |
void | gutsOfDestructor () |
The real work of desstructor. More... | |
void | gutsOfInitialize () |
The real work of constructor. More... | |
void | gutsOfCopy (const CoinDenseFactorization &other) |
The real work of copy. More... | |
Constructors and destructor and copy | |
CoinDenseFactorization () | |
Default constructor. More... | |
CoinDenseFactorization (const CoinDenseFactorization &other) | |
Copy constructor. More... | |
virtual | ~CoinDenseFactorization () |
Destructor. More... | |
CoinDenseFactorization & | operator= (const CoinDenseFactorization &other) |
= copy More... | |
virtual CoinOtherFactorization * | clone () const |
Clone. More... | |
Do factorization - public | |
virtual void | getAreas (int numberRows, int numberColumns, CoinBigIndex maximumL, CoinBigIndex maximumU) |
Gets space for a factorization. More... | |
virtual void | preProcess () |
PreProcesses column ordered copy of basis. More... | |
virtual int | factor () |
Does most of factorization returning status 0 - OK -99 - needs more memory -1 - singular - use numberGoodColumns and redo. More... | |
virtual void | postProcess (const int *sequence, int *pivotVariable) |
Does post processing on valid factorization - putting variables on correct rows. More... | |
virtual void | makeNonSingular (int *sequence, int numberColumns) |
Makes a non-singular basis by replacing variables. More... | |
general stuff such as number of elements | |
virtual int | numberElements () const |
Total number of elements in factorization. More... | |
double | maximumCoefficient () const |
Returns maximum absolute value in factorization. More... | |
rank one updates which do exist | |
virtual int | replaceColumn (CoinIndexedVector *regionSparse, int pivotRow, double pivotCheck, bool checkBeforeModifying=false, double acceptablePivot=1.0e-8) |
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. More... | |
various uses of factorization (return code number elements) | |
which user may want to know about | |
virtual int | updateColumnFT (CoinIndexedVector *regionSparse, CoinIndexedVector *regionSparse2, bool=false) |
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. More... | |
virtual 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. More... | |
virtual int | updateTwoColumnsFT (CoinIndexedVector *regionSparse1, CoinIndexedVector *regionSparse2, CoinIndexedVector *regionSparse3, bool noPermute=false) |
does FTRAN on two columns More... | |
virtual 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. More... | |
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. More... | |
virtual int * | indices () const |
Returns array to put basis indices in. More... | |
virtual int * | permute () const |
Returns permute in. More... | |
![]() | |
CoinOtherFactorization () | |
Default constructor. More... | |
CoinOtherFactorization (const CoinOtherFactorization &other) | |
Copy constructor. More... | |
virtual | ~CoinOtherFactorization () |
Destructor. More... | |
CoinOtherFactorization & | operator= (const CoinOtherFactorization &other) |
= copy More... | |
int | status () const |
Returns status. More... | |
void | setStatus (int value) |
Sets status. More... | |
int | pivots () const |
Returns number of pivots since factorization. More... | |
void | setPivots (int value) |
Sets number of pivots since factorization. More... | |
void | setNumberRows (int value) |
Set number of Rows after factorization. More... | |
int | numberRows () const |
Number of Rows after factorization. More... | |
int | numberColumns () const |
Total number of columns in factorization. More... | |
int | numberGoodColumns () const |
Number of good columns in factorization. More... | |
void | relaxAccuracyCheck (double value) |
Allows change of pivot accuracy check 1.0 == none >1.0 relaxed. More... | |
double | getAccuracyCheck () const |
Returns status. More... | |
int | maximumPivots () const |
Maximum number of pivots between factorizations. More... | |
virtual void | maximumPivots (int value) |
Set maximum pivots. More... | |
double | pivotTolerance () const |
Pivot tolerance. More... | |
void | pivotTolerance (double value) |
Returns status. More... | |
double | zeroTolerance () const |
Zero tolerance. More... | |
void | zeroTolerance (double value) |
Returns status. More... | |
double | slackValue () const |
Whether slack value is +1 or -1. More... | |
void | slackValue (double value) |
Returns status. More... | |
virtual CoinFactorizationDouble * | elements () const |
Returns array to put basis elements in. More... | |
virtual int * | pivotRow () const |
Returns pivot row. More... | |
virtual CoinFactorizationDouble * | workArea () const |
Returns work area. More... | |
virtual int * | intWorkArea () const |
Returns int work area. More... | |
virtual int * | numberInRow () const |
Number of entries in each row. More... | |
virtual int * | numberInColumn () const |
Number of entries in each column. More... | |
virtual CoinBigIndex * | starts () const |
Returns array to put basis starts in. More... | |
virtual int * | permuteBack () const |
Returns permute back. More... | |
int | solveMode () const |
Get solve mode e.g. More... | |
void | setSolveMode (int value) |
Set solve mode e.g. More... | |
virtual bool | wantsTableauColumn () const |
Returns true if wants tableauColumn in replaceColumn. More... | |
virtual void | setUsefulInformation (const int *info, int whereFrom) |
Useful information for factorization 0 - iteration number whereFrom is 0 for factorize and 1 for replaceColumn. More... | |
Protected Member Functions | |
int | checkPivot (double saveFromU, double oldPivot) const |
Returns accuracy status of replaceColumn returns 0=OK, 1=Probably OK, 2=singular. More... | |
Friends | |
void | CoinDenseFactorizationUnitTest (const std::string &mpsDir) |
Additional Inherited Members | |
![]() | |
double | pivotTolerance_ |
Pivot tolerance. More... | |
double | zeroTolerance_ |
Zero tolerance. More... | |
double | slackValue_ |
Whether slack value is +1 or -1. More... | |
double | relaxCheck_ |
Relax check on accuracy in replaceColumn. More... | |
CoinBigIndex | factorElements_ |
Number of elements after factorization. More... | |
int | numberRows_ |
Number of Rows in factorization. More... | |
int | numberColumns_ |
Number of Columns in factorization. More... | |
int | numberGoodU_ |
Number factorized in U (not row singletons) More... | |
int | maximumPivots_ |
Maximum number of pivots before factorization. More... | |
int | numberPivots_ |
Number pivots since last factorization. More... | |
int | status_ |
Status of factorization. More... | |
int | maximumRows_ |
Maximum rows ever (i.e. use to copy arrays etc) More... | |
CoinBigIndex | maximumSpace_ |
Maximum length of iterating area. More... | |
int * | pivotRow_ |
Pivot row. More... | |
CoinFactorizationDouble * | elements_ |
Elements of factorization and updates length is maxR*maxR+maxSpace will always be long enough so can have nR*nR ints in maxSpace. More... | |
CoinFactorizationDouble * | workArea_ |
Work area of numberRows_. More... | |
int | solveMode_ |
Solve mode e.g. More... | |
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 285 of file CoinDenseFactorization.hpp.
CoinDenseFactorization::CoinDenseFactorization | ( | ) |
Default constructor.
CoinDenseFactorization::CoinDenseFactorization | ( | const CoinDenseFactorization & | other | ) |
Copy constructor.
|
virtual |
Destructor.
CoinDenseFactorization& CoinDenseFactorization::operator= | ( | const CoinDenseFactorization & | other | ) |
= copy
|
virtual |
Clone.
Implements CoinOtherFactorization.
|
virtual |
Gets space for a factorization.
Implements CoinOtherFactorization.
|
virtual |
PreProcesses column ordered copy of basis.
Implements CoinOtherFactorization.
|
virtual |
Does most of factorization returning status 0 - OK -99 - needs more memory -1 - singular - use numberGoodColumns and redo.
Implements CoinOtherFactorization.
|
virtual |
Does post processing on valid factorization - putting variables on correct rows.
Implements CoinOtherFactorization.
|
virtual |
Makes a non-singular basis by replacing variables.
Implements CoinOtherFactorization.
|
inlinevirtual |
Total number of elements in factorization.
Implements CoinOtherFactorization.
Definition at line 330 of file CoinDenseFactorization.hpp.
double CoinDenseFactorization::maximumCoefficient | ( | ) | const |
Returns maximum absolute value in factorization.
|
virtual |
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
Implements CoinOtherFactorization.
|
inlinevirtual |
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
Implements CoinOtherFactorization.
Definition at line 363 of file CoinDenseFactorization.hpp.
|
virtual |
This version has same effect as above with FTUpdate==false so number returned is always >=0.
Implements CoinOtherFactorization.
|
virtual |
does FTRAN on two columns
Implements CoinOtherFactorization.
|
virtual |
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.
Implements CoinOtherFactorization.
|
inlinevirtual |
Get rid of all memory.
Reimplemented from CoinOtherFactorization.
Definition at line 390 of file CoinDenseFactorization.hpp.
|
inlinevirtual |
Returns array to put basis indices in.
Implements CoinOtherFactorization.
Definition at line 393 of file CoinDenseFactorization.hpp.
|
inlinevirtual |
Returns permute in.
Implements CoinOtherFactorization.
Definition at line 396 of file CoinDenseFactorization.hpp.
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.
|
protected |
Returns accuracy status of replaceColumn returns 0=OK, 1=Probably OK, 2=singular.
|
friend |