[SciPy-User] Sparse vector

Felix Schlesinger schlesin@cshl....
Wed Apr 28 16:21:06 CDT 2010

Francesc Alted <faltet <at> pytables.org> writes:
> A Wednesday 28 April 2010 06:36:48 Felix Schlesinger escrigué:
> True.  I, for one, have been lately pondering about a container that would use 
> compression specific for sparse matrices with emphasis in fast random access.  
> I'd say that a combination of Blosc and Cython would be really good at this, 
> and the implementation would not be too difficult.

A cython interface would be great to allow fast operations on the sparse 
array that cannot be expressed as simple numexpr expressions. One 
could simply loop over all non-zero entries with C speed.

> The hairy think is how to provide mathematical functionality for this sparse 
> container (making numexpr to understand these containers is appealing, but 
> would require a non-negligible amount of time).  Mmh, food for thought.

It might not be necessary. A combination of methods to extract 
non-zero values or convert slices to a (compressed) dense 
representation when linear access is needed and a fast  (cython)
 random-access interface would probably cover many use-cases.


More information about the SciPy-User mailing list