XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ csc_ilu0()

void csc_ilu0 ( int  n,
const double  val[],
const int  colptr[],
const int  rowind[],
int  base,
double  val2[],
double  d[],
int *  info 
)

Incomplete LU decomposition without fill-in (ILU0) (CSC)

Purpose
This routine computes the incomplete LU decomposition, without fill-in, of the coefficient matrix A of the sparse linear equations.
A = L * U + R
where R is the difference from the complete LU decomposition. Assuming that R is small, the following preconditioner matrix is obtained by solving the equations using this decomposition.
M = L * U
This routine outputs the lower triangular matrix L and the upper triangular matrix U in val2[]. And the diagonal elements of U are copied to d[]. val2[] and d[] will be used by csc_ilu_solve().
Parameters
[in]nDimension of matrix A. (n >= 0) (If n = 0, returns without computation)
[in]val[]Array val[lval] (lval >= nnz) (nnz is number of non-zero elements of matrix A)
Values of non-zero elements of matrix A.
[in]colptr[]Array colptr[lcolptr] (lcolptr >= n + 1)
Column pointers of matrix A.
[in]rowind[]Array rowind[lrowind] (lrowind >= nnz)
Row indices of matrix A.
[in]baseIndexing of colptr[] and rowind[].
= 0: Zero-based (C style) indexing: Starting index is 0.
= 1: One-based (Fortran style) indexing: Starting index is 1.
[out]val2[]Array val2[lval2] (lval2 >= nnz)
Values of non-zero elements of the lower triangular matrix L and the upper triangular matrix U. (nnz is same with the number of non-zero elements of A. The values are stored in the same location of lower and upper triangular elements of A.)
[out]d[]Array d[ld] (ld >= n)
The diagonal elements of upper triangular matrix U.
[out]info= 0: Successful exit.
= i < 0: The (-i)-th argument is invalid.
= j > 0: Matrix is singular (j-th diagonal element is zero).