Dip
0.92.4
|
This deals with Factorization and Updates This is a simple dense version so other people can write a better one. More...
#include <CoinAbcDenseFactorization.hpp>
Public Member Functions | |
void | gutsOfDestructor () |
The real work of desstructor. More... | |
void | gutsOfInitialize () |
The real work of constructor. More... | |
void | gutsOfCopy (const CoinAbcDenseFactorization &other) |
The real work of copy. More... | |
Constructors and destructor and copy | |
CoinAbcDenseFactorization () | |
Default constructor. More... | |
CoinAbcDenseFactorization (const CoinAbcDenseFactorization &other) | |
Copy constructor. More... | |
virtual | ~CoinAbcDenseFactorization () |
Destructor. More... | |
CoinAbcDenseFactorization & | operator= (const CoinAbcDenseFactorization &other) |
= copy More... | |
virtual CoinAbcAnyFactorization * | 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 (AbcSimplex *model) |
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) |
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 skipBtranU=false, double acceptablePivot=1.0e-8) |
Replaces one Column to basis, returns 0=OK, 1=Probably OK, 2=singular, 3=no room If skipBtranU is false will do btran part partial update already in U. More... | |
virtual int | checkReplacePart2 (int pivotRow, double btranAlpha, double ftranAlpha, double ftAlpha, double acceptablePivot=1.0e-8) |
Checks if can replace one Column to basis, returns 0=OK, 1=Probably OK, 2=singular, 3=no room, 5 max pivots. More... | |
virtual void | replaceColumnPart3 (const AbcSimplex *model, CoinIndexedVector *regionSparse, CoinIndexedVector *tableauColumn, int pivotRow, double alpha) |
Replaces one Column to basis, partial update already in U. More... | |
virtual void | replaceColumnPart3 (const AbcSimplex *model, CoinIndexedVector *regionSparse, CoinIndexedVector *tableauColumn, CoinIndexedVector *, int pivotRow, double alpha) |
Replaces one Column to basis, partial update in vector. More... | |
various uses of factorization (return code number elements) | |
which user may want to know about | |
virtual int | updateColumnFT (CoinIndexedVector ®ionSparse) |
Updates one column (FTRAN) from unpacked regionSparse Tries to do FT update number returned is negative if no room. More... | |
virtual int | updateColumnFTPart1 (CoinIndexedVector ®ionSparse) |
Updates one column (FTRAN) from unpacked regionSparse Tries to do FT update number returned is negative if no room. More... | |
virtual void | updateColumnFTPart2 (CoinIndexedVector &) |
Updates one column (FTRAN) from unpacked regionSparse Tries to do FT update number returned is negative if no room. More... | |
virtual void | updateColumnFT (CoinIndexedVector ®ionSparseFT, CoinIndexedVector &, int) |
Updates one column (FTRAN) from unpacked regionSparse Tries to do FT update number returned is negative if no room. More... | |
virtual int | updateColumn (CoinIndexedVector ®ionSparse) const |
This version has same effect as above with FTUpdate==false so number returned is always >=0. More... | |
virtual int | updateTwoColumnsFT (CoinIndexedVector ®ionFT, CoinIndexedVector ®ionOther) |
does FTRAN on two unpacked columns More... | |
virtual int | updateColumnTranspose (CoinIndexedVector ®ionSparse) const |
Updates one column (BTRAN) from unpacked regionSparse. More... | |
virtual void | updateFullColumn (CoinIndexedVector ®ionSparse) const |
This version does FTRAN on array when indices not set up. More... | |
virtual void | updateFullColumnTranspose (CoinIndexedVector ®ionSparse) const |
Updates one column (BTRAN) from unpacked regionSparse. More... | |
virtual void | updateWeights (CoinIndexedVector ®ionSparse) const |
Updates one column for dual steepest edge weights (FTRAN) 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... | |
![]() | |
CoinAbcAnyFactorization () | |
Default constructor. More... | |
CoinAbcAnyFactorization (const CoinAbcAnyFactorization &other) | |
Copy constructor. More... | |
virtual | ~CoinAbcAnyFactorization () |
Destructor. More... | |
CoinAbcAnyFactorization & | operator= (const CoinAbcAnyFactorization &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... | |
int | numberSlacks () const |
Returns number of slacks. More... | |
void | setNumberSlacks (int value) |
Sets number of slacks. More... | |
void | setNumberRows (int value) |
Set number of Rows after factorization. More... | |
int | numberRows () const |
Number of Rows after factorization. More... | |
CoinSimplexInt | numberDense () const |
Number of dense rows after 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 | minimumPivotTolerance () const |
Minimum pivot tolerance. More... | |
void | minimumPivotTolerance (double value) |
Returns status. More... | |
virtual CoinFactorizationDouble * | pivotRegion () const |
Returns status. More... | |
double | areaFactor () const |
Area factor. More... | |
void | areaFactor (CoinSimplexDouble value) |
Returns status. More... | |
double | zeroTolerance () const |
Zero tolerance. More... | |
void | zeroTolerance (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... | |
virtual void | goSparse () |
Sees whether to go sparse. More... | |
virtual void | checkMarkArrays () const |
Returns status. 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... | |
virtual int * | pivotColumn () const |
Returns pivotColumn or permute. More... | |
virtual double | checkReplacePart1 (CoinIndexedVector *, int) |
Checks if can replace one Column to basis, returns update alpha Fills in region for use later partial update already in U. More... | |
virtual double | checkReplacePart1 (CoinIndexedVector *, CoinIndexedVector *, int) |
Checks if can replace one Column to basis, returns update alpha Fills in region for use later partial update already in U. More... | |
virtual void | checkReplacePart1a (CoinIndexedVector *, int) |
Checks if can replace one Column to basis, returns update alpha Fills in region for use later partial update already in U. More... | |
virtual double | checkReplacePart1b (CoinIndexedVector *, int) |
Checks if can replace one Column to basis, returns update alpha Fills in region for use later partial update already in U. More... | |
virtual void | updateColumnCpu (CoinIndexedVector ®ionSparse, int whichCpu) const |
Updates one column (FTRAN) More... | |
virtual void | updateColumnTransposeCpu (CoinIndexedVector ®ionSparse, int whichCpu) const |
Updates one column (BTRAN) 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... | |
Protected Attributes | |
CoinBigIndex | maximumSpace_ |
Maximum length of iterating area. More... | |
CoinSimplexInt | maximumRowsAdjusted_ |
Use for array size to get multiple of 8. More... | |
![]() | |
double | pivotTolerance_ |
Pivot tolerance. More... | |
double | minimumPivotTolerance_ |
Minimum pivot tolerance. More... | |
double | areaFactor_ |
Area factor. More... | |
double | zeroTolerance_ |
Zero tolerance. 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 | numberDense_ |
Number of dense rows 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 | numberSlacks_ |
Number slacks. More... | |
int | status_ |
Status of factorization. More... | |
int | maximumRows_ |
Maximum rows ever (i.e. use to copy arrays etc) 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... | |
Friends | |
void | CoinAbcDenseFactorizationUnitTest (const std::string &mpsDir) |
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 442 of file CoinAbcDenseFactorization.hpp.
CoinAbcDenseFactorization::CoinAbcDenseFactorization | ( | ) |
Default constructor.
CoinAbcDenseFactorization::CoinAbcDenseFactorization | ( | const CoinAbcDenseFactorization & | other | ) |
Copy constructor.
|
virtual |
Destructor.
CoinAbcDenseFactorization& CoinAbcDenseFactorization::operator= | ( | const CoinAbcDenseFactorization & | other | ) |
= copy
|
virtual |
Clone.
Implements CoinAbcAnyFactorization.
|
virtual |
Gets space for a factorization.
Implements CoinAbcAnyFactorization.
|
virtual |
PreProcesses column ordered copy of basis.
Implements CoinAbcAnyFactorization.
|
virtual |
Does most of factorization returning status 0 - OK -99 - needs more memory -1 - singular - use numberGoodColumns and redo.
Implements CoinAbcAnyFactorization.
|
virtual |
Does post processing on valid factorization - putting variables on correct rows.
Implements CoinAbcAnyFactorization.
|
virtual |
Makes a non-singular basis by replacing variables.
Implements CoinAbcAnyFactorization.
|
inlinevirtual |
Total number of elements in factorization.
Implements CoinAbcAnyFactorization.
Definition at line 486 of file CoinAbcDenseFactorization.hpp.
double CoinAbcDenseFactorization::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 skipBtranU is false will do btran part partial update already in U.
|
virtual |
Checks if can replace one Column to basis, returns 0=OK, 1=Probably OK, 2=singular, 3=no room, 5 max pivots.
Implements CoinAbcAnyFactorization.
|
virtual |
Replaces one Column to basis, partial update already in U.
Implements CoinAbcAnyFactorization.
Referenced by replaceColumnPart3().
|
inlinevirtual |
Replaces one Column to basis, partial update in vector.
Implements CoinAbcAnyFactorization.
Definition at line 528 of file CoinAbcDenseFactorization.hpp.
References replaceColumnPart3().
|
inlinevirtual |
Updates one column (FTRAN) from unpacked regionSparse Tries to do FT update number returned is negative if no room.
Implements CoinAbcAnyFactorization.
Definition at line 549 of file CoinAbcDenseFactorization.hpp.
References updateColumn().
Referenced by updateColumnFT().
|
inlinevirtual |
Updates one column (FTRAN) from unpacked regionSparse Tries to do FT update number returned is negative if no room.
Implements CoinAbcAnyFactorization.
Definition at line 553 of file CoinAbcDenseFactorization.hpp.
References updateColumn().
|
inlinevirtual |
Updates one column (FTRAN) from unpacked regionSparse Tries to do FT update number returned is negative if no room.
Implements CoinAbcAnyFactorization.
Definition at line 557 of file CoinAbcDenseFactorization.hpp.
|
inlinevirtual |
Updates one column (FTRAN) from unpacked regionSparse Tries to do FT update number returned is negative if no room.
Implements CoinAbcAnyFactorization.
Definition at line 560 of file CoinAbcDenseFactorization.hpp.
References updateColumnFT().
|
virtual |
This version has same effect as above with FTUpdate==false so number returned is always >=0.
Implements CoinAbcAnyFactorization.
Referenced by updateColumnFT(), updateColumnFTPart1(), and updateFullColumn().
|
virtual |
does FTRAN on two unpacked columns
Implements CoinAbcAnyFactorization.
|
virtual |
Updates one column (BTRAN) from unpacked regionSparse.
Implements CoinAbcAnyFactorization.
Referenced by updateFullColumnTranspose().
|
inlinevirtual |
This version does FTRAN on array when indices not set up.
Implements CoinAbcAnyFactorization.
Definition at line 574 of file CoinAbcDenseFactorization.hpp.
References updateColumn().
|
inlinevirtual |
Updates one column (BTRAN) from unpacked regionSparse.
Implements CoinAbcAnyFactorization.
Definition at line 580 of file CoinAbcDenseFactorization.hpp.
References updateColumnTranspose().
|
virtual |
Updates one column for dual steepest edge weights (FTRAN)
Implements CoinAbcAnyFactorization.
|
inlinevirtual |
Get rid of all memory.
Reimplemented from CoinAbcAnyFactorization.
Definition at line 593 of file CoinAbcDenseFactorization.hpp.
|
inlinevirtual |
Returns array to put basis indices in.
Implements CoinAbcAnyFactorization.
Definition at line 598 of file CoinAbcDenseFactorization.hpp.
References CoinAbcAnyFactorization::elements_, and CoinAbcAnyFactorization::numberRows_.
|
inlinevirtual |
Returns permute in.
Implements CoinAbcAnyFactorization.
Definition at line 603 of file CoinAbcDenseFactorization.hpp.
void CoinAbcDenseFactorization::gutsOfDestructor | ( | ) |
The real work of desstructor.
void CoinAbcDenseFactorization::gutsOfInitialize | ( | ) |
The real work of constructor.
void CoinAbcDenseFactorization::gutsOfCopy | ( | const CoinAbcDenseFactorization & | other | ) |
The real work of copy.
|
protected |
Returns accuracy status of replaceColumn returns 0=OK, 1=Probably OK, 2=singular.
|
friend |
|
protected |
Maximum length of iterating area.
Definition at line 625 of file CoinAbcDenseFactorization.hpp.
|
protected |
Use for array size to get multiple of 8.
Definition at line 627 of file CoinAbcDenseFactorization.hpp.