
26 Jul
2011
26 Jul
'11
4:30 p.m.
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!