Jim Weirich wrote: > What does your C/C++ program do to get around this difficulty? Geert Fannes wrote: > The columns store the actual values (doubles), and the rows store > pointers to the corresponding doubles. This way, I can update a > double directly via the columns, via the rows after dereferencing > the pointers. > > (The real truth is a bit more complex since pointers on a 64 bit > machine take 64 bit, which wastes too much memory space. I > store float and unsigned int indices instead of pointers, but > the principle is the same) I think you are saying that the rows of your matrix contain the value, and the columns contain references (either pointers or indices) to the row values. Is that correct (modulo having rows/columns reversed)? I'm still unclear why this solution wouldn't work in Ruby. -- -- Jim Weirich jweirich / one.net http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)