Tuesday 18 March 2014

ILU0 implementation.



I have implemented the most basic function ilu0 that do the incomplete LU decomposition with 0-fill. I have drawn a table with the execution times of that algorithm using Matlab, my version and using the code that Kai implemented last year using ITSOL. The function right now can be used with real and complex numbers and has the milu='row' option implemented.

The table shows for a NxN sparse matrix with a number of non-zero elements NNZ, the time  of execution (tic - toc was used).

N-NNZ ILU0-mine ILU0-Matlab ILU0-ITSOL
50 - 683 0.000055 s 0.000065 s 0.00085 s
400 - 72435 0.027 s 0.024 s 0.04 s
2000 - 1805571 3.35 s 3.25 s 4.88 s
5000 - 6482839 14.2 s 14.5 s 22.75 s

It can be seen that the implementation using ITSOL is the slowest. Maybe just because the overhead of copying and translating data back and forth between Octave and ITSOL. Between my version and Matlab's there is almost no difference.


Here you can download the code (ilu0.cc). It does not have any test nor documentation written yet.
 

No comments:

Post a Comment