SoPlex
|
Implementation of sparse LU factorization. More...
#include <clufactor.h>
Classes | |
struct | Dring |
struct | L |
Data structures for saving the working matrix and L factor. More... | |
struct | Perm |
Data structures for saving the row and column permutations. More... | |
class | Pring |
Pivot Ring. More... | |
class | Temp |
Temporary data structures. More... | |
struct | U |
Data structures for saving the working matrix and U factor. More... | |
Public Member Functions | |
void | setTolerances (std::shared_ptr< Tolerances > tolerances) |
set tolerances | |
const std::shared_ptr< Tolerances > | tolerances () const |
get tolerances | |
Protected Member Functions | |
Solver methods | |
void | solveLright (R *vec) |
int | solveRight4update (R *vec, int *nonz, R eps, R *rhs, R *forest, int *forestNum, int *forestIdx) |
void | solveRight (R *vec, R *rhs) |
int | solveRight2update (R *vec1, R *vec2, R *rhs1, R *rhs2, int *nonz, R eps, R *forest, int *forestNum, int *forestIdx) |
void | solveRight2 (R *vec1, R *vec2, R *rhs1, R *rhs2) |
void | solveLeft (R *vec, R *rhs) |
int | solveLeftEps (R *vec, R *rhs, int *nonz, R eps) |
int | solveLeft2 (R *vec1, int *nonz, R *vec2, R eps, R *rhs1, R *rhs2) |
int | vSolveRight4update (R eps, R *vec, int *idx, R *rhs, int *ridx, int rn, R *forest, int *forestNum, int *forestIdx) |
int | vSolveRight4update2 (R eps, R *vec, int *idx, R *rhs, int *ridx, int rn, R *vec2, R eps2, R *rhs2, int *ridx2, int rn2, R *forest, int *forestNum, int *forestIdx) |
void | vSolveRight4update2sparse (R eps, R *vec, int *idx, R *rhs, int *ridx, int &rn, R eps2, R *vec2, int *idx2, R *rhs2, int *ridx2, int &rn2, R *forest, int *forestNum, int *forestIdx) |
sparse version of above method | |
int | vSolveRight4update3 (R eps, R *vec, int *idx, R *rhs, int *ridx, int rn, R *vec2, R eps2, R *rhs2, int *ridx2, int rn2, R *vec3, R eps3, R *rhs3, int *ridx3, int rn3, R *forest, int *forestNum, int *forestIdx) |
void | vSolveRight4update3sparse (R eps, R *vec, int *idx, R *rhs, int *ridx, int &rn, R eps2, R *vec2, int *idx2, R *rhs2, int *ridx2, int &rn2, R eps3, R *vec3, int *idx3, R *rhs3, int *ridx3, int &rn3, R *forest, int *forestNum, int *forestIdx) |
sparse version of above method | |
void | vSolveRightNoNZ (R *vec, R eps, R *rhs, int *ridx, int rn) |
int | vSolveLeft (R eps, R *vec, int *idx, R *rhs, int *ridx, int rn) |
void | vSolveLeftNoNZ (R eps, R *vec, R *rhs, int *ridx, int rn) |
int | vSolveLeft2 (R eps, R *vec, int *idx, R *rhs, int *ridx, int rn, R *vec2, R *rhs2, int *ridx2, int rn2) |
void | vSolveLeft2sparse (R eps, R *vec, int *idx, R *rhs, int *ridx, int &rn, R *vec2, int *idx2, R *rhs2, int *ridx2, int &rn2) |
sparse version of solving 2 systems of equations | |
int | vSolveLeft3 (R eps, R *vec, int *idx, R *rhs, int *ridx, int rn, R *vec2, R *rhs2, int *ridx2, int rn2, R *vec3, R *rhs3, int *ridx3, int rn3) |
void | vSolveLeft3sparse (R eps, R *vec, int *idx, R *rhs, int *ridx, int &rn, R *vec2, int *idx2, R *rhs2, int *ridx2, int &rn2, R *vec3, int *idx3, R *rhs3, int *ridx3, int &rn3) |
sparse version of solving 3 systems of equations | |
void | forestUpdate (int col, R *work, int num, int *nonz) |
void | update (int p_col, R *p_work, const int *p_idx, int num) |
void | updateNoClear (int p_col, const R *p_work, const int *p_idx, int num) |
void | factor (const SVectorBase< R > **vec, R threshold, R eps) |
Debugging | |
void | dump () const |
bool | isConsistent () const |
Protected Attributes | |
Protected data | |
SLinSolver< R >::Status | stat |
Status indicator. | |
int | thedim |
dimension of factorized matrix | |
int | nzCnt |
number of nonzeros in U | |
R | initMaxabs |
maximum abs number in initail Matrix | |
R | maxabs |
maximum abs number in L and U | |
R | rowMemMult |
factor of minimum Memory * number of nonzeros | |
R | colMemMult |
factor of minimum Memory * number of nonzeros | |
R | lMemMult |
factor of minimum Memory * number of nonzeros | |
Perm | row |
row permutation matrices | |
Perm | col |
column permutation matrices | |
L | l |
L matrix. | |
std::vector< R > | diag |
Array of pivot elements. | |
U | u |
U matrix. | |
R * | work |
Working array: must always be left as 0! | |
Timer * | factorTime |
Time spent in factorizations. | |
int | factorCount |
Number of factorizations. | |
int | hugeValues |
number of times huge values occurred during solve (only used in debug mode) | |
std::shared_ptr< Tolerances > | _tolerances |
Tolerances for the factorization. | |
Private Member Functions | |
Solving | |
These helper methods are used during the factorization process. The solve*-methods solve lower and upper triangular systems from the left or from the right, respectively The methods with '2' in the end solve two systems at the same time. The methods with "Eps" in the end consider elements smaller then the passed epsilon as zero. | |
void | solveUright (R *wrk, R *vec) const |
int | solveUrightEps (R *vec, int *nonz, R eps, R *rhs) |
void | solveUright2 (R *work1, R *vec1, R *work2, R *vec2) |
int | solveUright2eps (R *work1, R *vec1, R *work2, R *vec2, int *nonz, R eps) |
void | solveLright2 (R *vec1, R *vec2) |
void | solveUpdateRight (R *vec) |
void | solveUpdateRight2 (R *vec1, R *vec2) |
void | solveUleft (R *work, R *vec) |
void | solveUleft2 (R *work1, R *vec1, R *work2, R *vec2) |
int | solveLleft2forest (R *vec1, int *, R *vec2, R) |
void | solveLleft2 (R *vec1, int *, R *vec2, R) |
int | solveLleftForest (R *vec, int *, R) |
void | solveLleft (R *vec) const |
int | solveLleftEps (R *vec, int *nonz, R eps) |
void | solveUpdateLeft (R *vec) |
void | solveUpdateLeft2 (R *vec1, R *vec2) |
void | updateSolutionVectorLright (R change, int j, R &vec, int *idx, int &nnz) |
void | vSolveLright (R *vec, int *ridx, int &rn, R eps) |
void | vSolveLright2 (R *vec, int *ridx, int &rn, R eps, R *vec2, int *ridx2, int &rn2, R eps2) |
void | vSolveLright3 (R *vec, int *ridx, int &rn, R eps, R *vec2, int *ridx2, int &rn2, R eps2, R *vec3, int *ridx3, int &rn3, R eps3) |
int | vSolveUright (R *vec, int *vidx, R *rhs, int *ridx, int rn, R eps) |
void | vSolveUrightNoNZ (R *vec, R *rhs, int *ridx, int rn, R eps) |
int | vSolveUright2 (R *vec, int *vidx, R *rhs, int *ridx, int rn, R eps, R *vec2, R *rhs2, int *ridx2, int rn2, R eps2) |
int | vSolveUpdateRight (R *vec, int *ridx, int n, R eps) |
void | vSolveUpdateRightNoNZ (R *vec, R) |
int | solveUleft (R eps, R *vec, int *vecidx, R *rhs, int *rhsidx, int rhsn) |
void | solveUleftNoNZ (R eps, R *vec, R *rhs, int *rhsidx, int rhsn) |
int | solveLleftForest (R eps, R *vec, int *nonz, int n) |
void | solveLleftForestNoNZ (R *vec) |
int | solveLleft (R eps, R *vec, int *nonz, int rn) |
void | solveLleftNoNZ (R *vec) |
int | solveUpdateLeft (R eps, R *vec, int *nonz, int n) |
void | forestPackColumns () |
void | forestMinColMem (int size) |
void | forestReMaxCol (int col, int len) |
void | initPerm () |
void | initFactorMatrix (const SVectorBase< R > **vec, const R eps) |
void | minLMem (int size) |
void | setPivot (const int p_stage, const int p_col, const int p_row, const R val) |
void | colSingletons () |
void | rowSingletons () |
void | initFactorRings () |
void | freeFactorRings () |
int | setupColVals () |
void | setupRowVals () |
void | eliminateRowSingletons () |
void | eliminateColSingletons () |
void | selectPivots (R threshold) |
int | updateRow (int r, int lv, int prow, int pcol, R pval, R eps) |
void | eliminatePivot (int prow, int pos, R eps) |
void | eliminateNucleus (const R eps, const R threshold) |
void | minRowMem (int size) |
void | minColMem (int size) |
void | remaxCol (int p_col, int len) |
void | packRows () |
void | packColumns () |
void | remaxRow (int p_row, int len) |
int | makeLvec (int p_len, int p_row) |
Private Attributes | |
Private data | |
Temp | temp |
Temporary storage. | |
Implementation of sparse LU factorization.
This class implements a sparse LU factorization with either FOREST-TOMLIN or ETA updates, using dynamic Markowitz pivoting.
Definition at line 49 of file clufactor.h.
|
private |
|
protected |
|
private |
|
private |
|
private |
|
private |
|
protected |
vec | Array of column VectorBase<R> pointers |
threshold | pivoting threshold |
eps | epsilon for zero detection |
|
private |
|
private |
|
private |
References col.
|
protected |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
void setTolerances | ( | std::shared_ptr< Tolerances > | tolerances | ) |
|
private |
|
private |
|
protected |
|
protected |
|
protected |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
References work.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
const std::shared_ptr< Tolerances > tolerances | ( | ) | const |
get tolerances
Definition at line 59 of file clufactor.h.
References _tolerances.
Referenced by setTolerances(), and SLUFactor< R >::setTolerances().
|
protected |
|
protected |
|
private |
|
private |
|
protected |
|
protected |
|
protected |
sparse version of solving 2 systems of equations
|
protected |
|
protected |
sparse version of solving 3 systems of equations
|
protected |
|
private |
|
private |
|
private |
|
protected |
|
protected |
|
protected |
sparse version of above method
|
protected |
|
protected |
sparse version of above method
|
protected |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
Tolerances for the factorization.
Definition at line 230 of file clufactor.h.
Referenced by setTolerances(), SLUFactor< R >::setTolerances(), and tolerances().
|
protected |
column permutation matrices
Definition at line 219 of file clufactor.h.
Referenced by forestReMaxCol(), and forestUpdate().
|
protected |
factor of minimum Memory * number of nonzeros
Definition at line 215 of file clufactor.h.
|
protected |
Array of pivot elements.
Definition at line 222 of file clufactor.h.
|
protected |
Number of factorizations.
Definition at line 228 of file clufactor.h.
Referenced by SLUFactor< R >::getFactorCount(), and SLUFactor< R >::resetCounters().
|
protected |
Time spent in factorizations.
Definition at line 227 of file clufactor.h.
Referenced by SLUFactor< R >::changeTimer(), SLUFactor< R >::getFactorTime(), SLUFactor< R >::resetCounters(), and SLUFactor< R >::resetFactorTime().
|
protected |
number of times huge values occurred during solve (only used in debug mode)
Definition at line 229 of file clufactor.h.
Referenced by SLUFactor< R >::resetCounters().
|
protected |
maximum abs number in initail Matrix
Definition at line 211 of file clufactor.h.
|
protected |
|
protected |
factor of minimum Memory * number of nonzeros
Definition at line 216 of file clufactor.h.
|
protected |
Definition at line 212 of file clufactor.h.
|
protected |
number of nonzeros in U
Definition at line 210 of file clufactor.h.
Referenced by SLUFactor< R >::memory().
|
protected |
row permutation matrices
Definition at line 218 of file clufactor.h.
|
protected |
factor of minimum Memory * number of nonzeros
Definition at line 214 of file clufactor.h.
|
protected |
Status indicator.
Definition at line 207 of file clufactor.h.
Referenced by SLUFactor< R >::status().
|
private |
Temporary storage.
Definition at line 238 of file clufactor.h.
|
protected |
dimension of factorized matrix
Definition at line 209 of file clufactor.h.
Referenced by SLUFactor< R >::dim().
|
protected |
U matrix.
Definition at line 223 of file clufactor.h.
|
protected |
Working array: must always be left as 0!
Definition at line 225 of file clufactor.h.
Referenced by forestUpdate(), and solveUleft().