------_extPart_001_01C6447F.AA523840
Content-Type: text/plain;
	charsetso-8859-1"
Content-Transfer-Encoding: quoted-printable

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)

Greetings,
Geert.


-----Original Message-----
From: Jim Weirich [mailto:jim / weirichhouse.org]
Sent: Fri 3/10/2006 8:23 PM
To: ruby-core / ruby-lang.org
Subject: Re: how to introduce reference objects into ruby
 
Geert Fannes wrote:
[... example code elided ...]
> Unfortunately, this code duplicates the content values of the matrix, it
> has a copy inside the @columns and one inside the @rows and these need
> to be maintained so they stay the same, which is programming and
> execution overhead.

What does your C/C++ program do to get around this difficulty?

-- 
-- 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)



------_extPart_001_01C6447F.AA523840--