<< Overview Spilu spilu_ilud >>

Spilu >> Spilu > spilu_ilu0

spilu_ilu0

ILU(0) preconditioning.

Calling Sequence

[L,U]=spilu_ilu0(A)

Parameters

A

n-by-n sparse real matrix of doubles

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
      

ILU0 is not recommended for realistic problems. It is only provided for comparison purposes.

All the diagonal elements of the input matrix must be nonzero.

Examples

// Incomplete factorization of a 6-by-6 sparse matrix
// nnz(A)=16
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);
//
expL=[
1.     0.    0.     0.           0.           0.  
-2.    1.    0.     0.           0.           0.  
0.     0.    1.     0.           0.           0.  
0.     0.   -3.5    1.           0.           0.  
3.     0.    0.     0.4210526    1.           0.  
0.     5.    0.     0.           1.1666667    1.  
];
expU=[
-1.    3.    0.    0.     4.    0.  
0.     1.    0.    0.     0.    1.  
0.     0.   -2.    3.     0.    0.  
0.     0.    0.    9.5    0.    0.  
0.     0.    0.    0.    -6.    0.  
0.     0.    0.    0.     0.    3.  
];
[L,U]=spilu_ilu0(A)
// Check the quality of the decomposition
[norm(A-L*U,"inf")/norm(A,"inf") nnz(L)+nnz(U)]

// Incomplete factorization of a 237-by-237 sparse matrix
// nnz(A)=1017
path = spilu_getpath (  );
filename = fullfile(path,"tests","matrices","nos1.mtx");
A=mmread(filename);
n=size(A,1);
b=ones(n,1);
[L,U]=spilu_ilu0(A);
x=U\(L\b);
norm(A*x-b)

Authors

Copyright (C) 2011 - DIGITEO - Michael Baudin

Copyright (C) 2011 - NII - Benoit Goepfert

Copyright (C) 2005 - INRIA - Sage Group (IRISA)

Copyright (C) 1993 - Univ. of Tennessee and Oak Ridge National Laboratory - Youcef Saad


<< Overview Spilu spilu_ilud >>