Geert Fannes wrote:
> The problem with the code you sent is that you have to go through ALL
> your matrix elements to get a certain row or column, which takes too
> long. Remember that this is a LARGE matrix (my current C implementation
> can handle 100M row and cols and 800M elements).

Well, consider that in a perfect world with zero storage overhead, you'd 
be looking at 4 bytes for the row, 4 bytes for the column, 8 bytes for a 
float, multiply by 800M elements active in your sparse array and by my 
calculations you've got 12GB of data before you even start hashing anything.

Given that size of problem, I'd be strongly inclined to move it out of 
RAM into a relational database. Especially if you want to be able to 
iterate along any row or column, as you apparently do. In which case, 
you might as well use Ruby :-)


mathew