<< spilu_ilu0M Support spilu_permVecToMat >>

Spilu >> Spilu > Support > spilu_ilukM

spilu_ilukM

ILU preconditioning with level of fill-in of k (macro).

Calling Sequence

[L, U] = spilu_ilukM(A)
[L, U] = spilu_ilukM(A,lfil)

Parameters

A :

n-by-n sparse real matrix of doubles

lfil :

a 1-by-1 matrix of doubles, integer value, positive, the fill-in parameter (default: lfil=floor(1+nnz(A)/n), i.e. the average number of nonzero elements of the matrix A by line). Entries whose levels-of-fill exceed lfil during the ILU process are dropped.

L :

n-by-n sparse real matrix of doubles, lower triangular matrix

U :

n-by-n sparse real matrix of doubles, upper triangular matrix

Description

Builds an incomplete LU factorization of the sparse matrix A, that is, computes a lower triangular matrix L and an upper triangular matrix U such that

A ≈ L*U

This function uses an ILU with level of fill-in of K (ILU(k)).

If lfil==0, then spilu_ilukM produces the same output as spilu_ilu0M.

This function is a macro. The purpose of this function is to reproduce the spilu_iluk function for small sparse matrices with a simple script. This function is a Scilab port of Youcef Saad's iluk Matlab function.

Examples

// A 6-by-6 matrix
A=[
-1.    3.    0.    0.    4.    0.
2.   -5.    0.    0.    0.    1.
0.    0.   -2.    3.    0.    0.
0.    0.    7.   -1.    0.    0.
-3.    0.    0.    4.    6.    0.
0.    5.    0.    0.   -7.    8.
];
A=sparse(A);
[L,U]=spilu_ilukM(A,lfil)
// See the norm of the residual matrix
norm(A-L*U)
// Configure level of fill
n = size(A,"r");
lfil=floor(1+nnz(A)/n);
[L,U]=spilu_ilukM(A,lfil)

// Decompose a 237-by-237 sparse matrix.
path = spilu_getpath (  );
filename = fullfile(path,"tests","matrices","nos1.mtx");
A=mmread(filename);
[L,U]=spilu_ilukM(A,10);
norm(A-L*U)

// To edit the code
edit spilu_ilukM

Authors


Report an issue
<< spilu_ilu0M Support spilu_permVecToMat >>