A generic hub for various incomplete LU algorithms.
[L,U,perm] = spilu_iluhub(A,m) [L,U,perm] = spilu_iluhub(A,m,a1) [L,U,perm] = spilu_iluhub(A,m,a1,a2) [L,U,perm] = spilu_iluhub(A,m,a1,a2,...)
n-by-n sparse real matrix of doubles
1-by-1 matrix of strings, the ILU method. Available methods are m = "ilu0", "ilud", "iludp", "iluk", "ilut", "ilutp", "milu0"
optional parameters of the ILU method
n-by-n sparse real matrix of doubles, lower triangular matrix
n-by-n sparse real matrix of doubles, upper triangular matrix
a 1-by-n dense real matrix of doubles, integer value, the permutation arrays
Builds an incomplete LU factorization of the sparse matrix A
,
with the method m
.
The extra arguments a1, a2, ...
are automatically
passed to the specific ILU function: see in the specific
help page for the meaning of the parameters.
If the specific algorithm does not produce a
permutation vector perm
, then
the permutation is the identity.
// A small 3-by-3 matrix // nnz(A)=7 A = [ 1 2 0 3 4 5 0 6 7 ]; A = sparse(A); [L,U,perm]=spilu_iluhub(A,"ilu0") // Test ilud alph = 0.1; drop = 0.001; [L,U,perm]=spilu_iluhub(A,"ilud",alph,drop) // Test all methods marray = spilu_iluhubavail(); for m = marray mprintf("Method: %s\n",m); [L,U,perm]=spilu_iluhub(A,m); mprintf(" nnz(LU)= %d\n",nnz(L)+nnz(U)); end | ![]() | ![]() |