Sparse matrices / arrays in Java
Posted
by DanM
on Stack Overflow
See other posts from Stack Overflow
or by DanM
Published on 2008-12-23T21:55:14Z
Indexed on
2010/03/22
21:41 UTC
Read the original article
Hit count: 571
I'm working on a project, written in Java, which requires that I build a very large 2-D sparse array. Very sparse, if that makes a difference. Anyway: the most crucial aspect for this application is efficency in terms of time (assume loads of memory, though not nearly so unlimited as to allow me to use a standard 2-D array -- the key range is in the billions in both dimensions).
Out of the kajillion cells in the array, there will be several hundred thousand cells which contain an object. I need to be able to modify cell contents VERY quickly.
Anyway: Does anyone know a particularly good library for this purpose? It would have to be Berkeley, LGPL or similar license (no GPL, as the product can't be entirely open-sourced). Or if there's just a very simple way to make a homebrew sparse array object, that'd be fine too.
I'm considering MTJ, but haven't heard any opinions on its quality.
Thanks!! -Dan
© Stack Overflow or respective owner