[Numpy-discussion] Tuning sparse stuff in NumPy

Robert Cimrman cimrman3@ntc.zcu...
Mon Mar 26 10:17:34 CDT 2007

David Koch wrote:
> Hi,
> I ran some tests on the very same matrices in Matlab/Numpy and it seems
> that
> for sparse matrix multipilcation to be faster than dense multiplication -
> the degree of sparsity has to be much higher in Numpy than in Matlab. Is
> there anything I can tune in the underlying routines? I need good
> performance at about 0.02 +- 0.01 nnz elements.

Hi David,

Could you be more specific on which type of the sparse matrix storage
did you use? They are not equivalent in performance w.r.t. different
aspects, e.g. LIL, DOK matrices a good for populating an empty sparse
matrix, while CSR, CSC should be used for computations.


More information about the Numpy-discussion mailing list