|
|
◆ z_csr_ilu()
| void z_csr_ilu |
( |
int |
n, |
|
|
const doublecomplex |
val[], |
|
|
const int |
rowptr[], |
|
|
const int |
colind[], |
|
|
int |
base, |
|
|
int |
p, |
|
|
int |
md, |
|
|
int |
nnz2, |
|
|
doublecomplex |
val2[], |
|
|
int |
rowptr2[], |
|
|
int |
colind2[], |
|
|
int |
base2, |
|
|
doublecomplex |
d[], |
|
|
doublecomplex |
work[], |
|
|
int |
iwork[], |
|
|
int * |
info |
|
) |
| |
Incomplete LU decomposition with level (ILU(p)) (Complex matrices) (CSR)
- Purpose
- This routine computes the incomplete LU decomposition of the coefficient matrix A of the sparse linear equations. 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. In order to suppress fill-ins, new non-zero elements generated during decomposition with level values larger than the specified value p are dropped. This is called as ILU(p).
Level values are initialized as follows. lev(a(i,j)) = 0 (if a(i,j) != 0 or i = j),
= ∞ (if a(i,j) = 0)
In the elimination process of LU decomposition, the operation a(i,j) = a(i,j) - a(i,k)*a(k,j) is required. At the time, the level value of a(i,j) is updated as follows. lev(a(i,j)) = min{ lev(a(i,j)), lev(a(i,k)) + lev(a(k,j)) + 1 }
Due to this algorithm, the level of the position of the non-zero element of A before decomposition remains 0 until the last. When decomposition is completed, elements with level values greater than p are dropped.
This routine outputs the lower triangular matrix L and the upper triangular matrix U in val2[], colind2[] and rowptr2[]. The diagonal elements of U are copied to d[]. val2[], colind2[], rowptr2[] and d[] will be used by csr_ilu_solve().
- Parameters
-
| [in] | n | Dimension 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] | rowptr[] | Array rowptr[lrowptr] (lrowptr >= n + 1)
Row pointers of matrix A. |
| [in] | colind[] | Array colind[lcolind] (lcolind >= nnz)
Column indices of matrix A. |
| [in] | base | Indexing of rowptr[] and colind[].
= 0: Zero-based (C style) indexing: Starting index is 0.
= 1: One-based (Fortran style) indexing: Starting index is 1. |
| [in] | p | The value of level p of ILU(p) algorithm. (p >= 0)
Note: it is possible to set p = 0. However, it is recommended to use csr_ilu0() since it is faster. |
| [in] | md | Specify whether the diagonal compensation of the dropped elements are required. ILU with this compensation is called as MILU (modified ILU).
= 0: ILU (no compensation).
= 1: MILU (with diagonal compensation).
(For other values, md = 0 is assumed.) |
| [in] | nnz2 | Maximum number of non-zero elements of matrix L*U. If the number of non-zero elements exceeds this during the factorization, the routine will terminatd with error (info = -8). |
| [out] | val2[] | Array val2[lval2] (lval2 >= nnz2)
Values of non-zero elements of the lower triangular matrix L and the upper triangular matrix U. |
| [out] | rowptr2[] | Array rowptr2[lrowptr2] (lrowptr2 >= n + 1)
Column pointers of matrix L*U. |
| [out] | colind2[] | Array colind2[lcolind2] (lcolind2 >= nnz2)
Row indices of matrix L*U. |
| [in] | base2 | Indexing of rowptr2[] and colind2[].
= 0: Zero-based (C style) indexing: Starting index is 0.
= 1: One-based (Fortran style) indexing: Starting index is 1. |
| [out] | d[] | Array d[ld] (ld >= n)
The diagonal elements of upper triangular matrix U. |
| [out] | work[] | Array work[lwork] (lwork >= n)
Work array. |
| [out] | iwork[] | Array iwork[liwork] (liwork >= nnz2 + 2*n)
Integer work array. |
| [out] | info | = 0: Successful exit.
= i < 0: The (-i)-th argument is invalid.
= j > 0: Matrix is singular (j-th diagonal element is zero). |
|