>> A_sparse = spconvert([... 1 4 2 3 3 4 2 5; % row indices 1 1 2 3 4 4 5 5; % column indices 1 2 3 4 5 6 7 8 % non-zero values ]'); >> [L,U] = iluk(A_sparse) L = Compressed Column Sparse (rows = 5, cols = 5, nnz = 6 [24%]) (1, 1) -> 1 (4, 1) -> 2 (2, 2) -> 1 (3, 3) -> 1 (4, 4) -> 1 (5, 5) -> 1 U = Compressed Column Sparse (rows = 5, cols = 5, nnz = 7 [28%]) (1, 1) -> 1 (2, 2) -> 3 (3, 3) -> 4 (3, 4) -> 5 (4, 4) -> 6 (2, 5) -> 7 (5, 5) -> 8 >> L * U - A_sparse % Should be a zero matrix ans = Compressed Column Sparse (rows = 5, cols = 5, nnz = 0 [0%])
Another example from MATLAB http://www.mathworks.com/help/matlab/ref/ilu.html
>> A = gallery('neumann', 1600) + speye(1600); >> nnz(A) ans = 7840 >> nnz(lu(A)) ans = 126402 >> [L,U] = iluk(A); >> nnz(L+U-speye(size(A))) % This behaviour will be added to ilu.m later ans = 7840
Now I'm very optimistic, that the ILUT and ILUC will be interfaced till the end of the next week.
No comments:
Post a Comment