SuperLU
here,
- and are row and col permutation matrices
- and are row and col scaling diagonal matrices
- is unit lower triangular matrix
- is an upper triangular matrix
To solve
A is given by
is given by
Therefore,
Please read from right to left.
Note that and operates on column vectors only.
Simple Driver algorithm
-
Choose to order the columns of to increase the sparsity of the computed and factors, and hopefully to increase parallelism
-
Compute factorization of . Most of the pkgs, including SuperLU, can perform dynamic pivoting with row interchanges for numerical stability, computing , and at the same time.
-
Solve the system using s and and as described above (with s equal to identity)
Expert Driver Algorithm for sequential and multithreaded
-
Equilibrate the matrix , that is, compute diagonal matrices and so that is better conditioned than , that is, is less sensitive to perturbations in that is to perturbations in .
-
Order the columns of to increase the sparsity of computed and factors. In other words replace by .
-
Compute the factorization of
Column ordering
- Natural ordering
- Multiple Minimum Degree applied to the structure of
- MMD applied to the structure of
- Column Approximation Minimum Degree (COLAMD)
- User supplied ordering, e.g., from Metis
Sequential SuperLU
- SuperLU can preorder the columns
- Threshold row pivoting
- equilibrate the system
- estimate the condition number
- relative backward error bounds
- ILU factorization
- Real and complex with single and double precision
Useful routines
- dgssv() solves the system of linear equations , using the LU factorization from
DGSTRF
. - dgssvx() solves the system of linear equations or
- dgstrf()
- dgstrs()
- dgscon()
- dgsequ()
- dlaqgs()
- dgsrfs()
- dgsisx()
- dgsitrf()
Data structure
typedef struct {
Stype_t Stype; /* Storage type: interprets the storage structure
pointed to by *Store. */
Dtype_t Dtype; /* Data type. */
Mtype_t Mtype; /* Matrix type: describes the mathematical property of
the matrix. */
int_t nrow; /* number of rows */
int_t ncol; /* number of columns */
void *Store; /* pointer to the actual storage of the matrix */
} SuperMatrix;
typedef struct {
int_t nnz; /* number of nonzeros in the matrix */
void *nzval; /* pointer to array of nonzero values, packed by column */
int_t *rowind; /* pointer to array of row indices of the nonzeros */
int_t *colptr; /* pointer to array of beginning of columns in nzval[]
and rowind[] */
/* Note:
Zero-based indexing is used;
colptr[] has ncol+1 entries, the last one pointing
beyond the last column, so that colptr[ncol] = nnz. */
} NCformat;
typedef struct {
int_t nnz; /* number of nonzeros in the matrix */
void *nzval; /* pointer to array of nonzero values, packed by raw */
int_t *colind; /* pointer to array of columns indices of the nonzeros */
int_t *rowptr; /* pointer to array of beginning of rows in nzval[]
and colind[] */
/* Note:
Zero-based indexing is used;
rowptr[] has nrow+1 entries, the last one pointing
beyond the last row, so that rowptr[nrow] = nnz. */
} NRformat;
How to call SuperLU
Installation
Installation by using cmake:
Configuration:
export build_dir=$HOME/temp/easifem-extpkgs/superlu/build/
export install_dir=$HOME/.easifem/extpkgs/
cmake -S . -B $build_dir \
-D CMAKE_INSTALL_PREFIX=$install_dir \
-D BUILD_SHARED_LIBS:BOOL=ON \
-D CMAKE_BUILD_TYPE=Release
Build step:
cmake -B $build_dir
Install step
cmake --build $build_dir --target install
SuperLU will be installed at $install_dir/lib
and $install_dir/include