[Haskell-cafe] Library for Sparse Vectors?

dokondr dokondr at gmail.com
Tue Jul 26 22:30:54 CEST 2011


Hi,
Can't find on hackage any sparse vector library. Does such thing exist?
I need efficient storage and dot product calculation for very sparse
vectors with about 10 out of 40 000 non-zero components.
One solution would be to represent Sparse Vector as Data.Map with
(component_index, component_value) pairs to store non-zero components of the
vector.
In this case, for example, calculating cosine similarity (
http://en.wikipedia.org/wiki/Cosine_similarity) for for every pair of 10 000
vectors, would not be very nice and efficient, I am afraid.

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110727/c58c8ee0/attachment.htm>


More information about the Haskell-Cafe mailing list