ILU0 preconditioner based on incomplete LU factorization of a sparse matrix.

Syntax

void dcsrilu0 (const MKL_INT *n , const double *a , const MKL_INT *ia , const MKL_INT *ja , double *bilu0 , const MKL_INT *ipar , const double *dpar , MKL_INT *ierr );

Include Files

  • mkl.h

Description

The routine dcsrilu0 computes a preconditioner B [Saad03] of a given sparse matrix A stored in the format accepted in the direct sparse solvers:

A~B=L*U , where L is a lower triangular matrix with a unit diagonal, U is an upper triangular matrix with a non-unit diagonal, and the portrait of the original matrix A is used to store the incomplete factors L and U.

CAUTION

This routine supports only one-based indexing of the array parameters.

Input Parameters

n

Size (number of rows or columns) of the original square n-by-n matrix A.

a

Array containing the set of elements of the matrix A. Its length is equal to the number of non-zero elements in the matrix A. Refer to the values array description in the Sparse Matrix Storage Format for more details.

ia

Array of size (n+1) containing begin indices of rows of the matrix A such that ia[i] is the index in the array a of the first non-zero element from the row i. The value of the last element ia[n] is equal to the number of non-zero elements in the matrix A, plus one. Refer to the rowIndex array description in the Sparse Matrix Storage Format for more details.

ja

Array containing the column indices for each non-zero element of the matrix A. It is important that the indices are in increasing order per row. The matrix size is equal to the size of the array a. Refer to the columns array description in the Sparse Matrix Storage Format for more details.

CAUTION

If column indices are not stored in ascending order for each row of matrix, the result of the routine might not be correct.

ipar

Array of size 128. This parameter specifies the integer set of data for both the ILU0 and RCI FGMRES computations. Refer to the ipar array description in the FGMRES Common Parameters for more details on FGMRES parameter entries. The entries that are specific to ILU0 are listed below.

ipar[30]

specifies how the routine operates when a zero diagonal element occurs during calculation. If this parameter is set to 0 (the default value set by the routine dfgmres_init), then the calculations are stopped and the routine returns a non-zero error value. Otherwise, the diagonal element is set to the value of dpar[31] and the calculations continue.

Note

You can declare the ipar array with a size of 32. However, for future compatibility you must declare the array ipar with length 128.

dpar

Array of size 128. This parameter specifies the double precision set of data for both the ILU0 and RCI FGMRES computations. Refer to the dpar array description in the FGMRES Common Parameters for more details on FGMRES parameter entries. The entries specific to ILU0 are listed below.

dpar[30]

specifies a small value, which is compared with the computed diagonal elements. When ipar[30] is not 0, then diagonal elements less than dpar[30] are set to dpar[31]. The default value is 1.0e-16.

Note

This parameter can be set to the negative value, because the calculation uses its absolute value.

If this parameter is set to 0, the comparison with the diagonal element is not performed.

dpar[31]

specifies the value that is assigned to the diagonal element if its value is less than dpar[30] (see above). The default value is 1.0e-10.

Note

You can declare the dpar array with a size of 32. However, for future compatibility you must declare the array dpar with length 128.

Output Parameters

bilu0

Array B containing non-zero elements of the resulting preconditioning matrix B, stored in the format accepted in direct sparse solvers. Its size is equal to the number of non-zero elements in the matrix A. Refer to the values array description in the Sparse Matrix Storage Format section for more details.

ierr

Error flag, gives information about the routine completion.

Note

To present the resulting preconditioning matrix in the CSR3 format the arrays ia (row indices) and ja (column indices) of the input matrix must be used.

Return Values

ierr=0

Indicates that the task completed normally.

ierr=-101

Indicates that the routine was interrupted and that error occurred: at least one diagonal element is omitted from the matrix in CSR3 format (see Sparse Matrix Storage Format).

ierr=-102

Indicates that the routine was interrupted because the matrix contains a diagonal element with the value of zero.

ierr=-103

Indicates that the routine was interrupted because the matrix contains a diagonal element which is so small that it could cause an overflow, or that it would cause a bad approximation to ILU0.

ierr=-104

Indicates that the routine was interrupted because the memory is insufficient for the internal work array.

ierr=-105

Indicates that the routine was interrupted because the input matrix size n is less than or equal to 0.

ierr=-106

Indicates that the routine was interrupted because the column indices ja are not in the ascending order.

有关编译器优化的更完整信息,请参阅优化通知
选择粘滞按钮颜色: 
Orange (only for download buttons)