[SciPy-User] Sparse Matricies and NNLS

Pauli Virtanen pav@iki...
Thu Mar 28 15:48:26 CDT 2013

28.03.2013 21:46, Calvin Morrison kirjoitti:
> I was thinking about using a sparse matrix since it is relatively
> sparse, but the problem is that even if I was to use the sparse
> matricies, the nnls function only accepts a ndarray, not a sparse
> matrix. (when I try and throw a sparse matrix at it I get an error.)

The nnls algorithm in Scipy relies on dense matrix algebra, and is
moreover written in Fortran. So, there is no way to tell it to use
sparse matrices.

You'll need to find an implementation of NNLS algorithm that either is
matrix-free or works for sparse problems. If you find such code, be sure
to reply to this list --- it might be useful to include it in Scipy,
provided the license is compatible.

Pauli Virtanen

More information about the SciPy-User mailing list