The Matrix to end all Matrix classes (Let's dream!)

0ffh frank at frankhirsch.youknow.what.todo.net
Tue Nov 20 16:35:14 PST 2007


Hi, regarding the organisation of matrices maybe it'd pay to take a look at 
how Lush is doing them, as it's designed (and known) to do them quite well.
I'll quote from the Lush tutorial:

Matrices are really composed of two separate entities:

  * the storage or srg which contains the following fields: a pointer to the
actual data , an element type identifier (and the size thereof) , and flags
that indicate if the data is writable or not , if it is in RAM or
memory-mapped from a file.

  * the index or idx points to a srg and contains the following fields: the 
number of dimensions of the tensor , the size in each dimension , the 
address increment from one element to the next in each dimension (called 
modulo ) , and the offset of the first tensor element in the storage . This 
structure allows multiple idx to point to the same srg thereby allowing the 
data to be accessed in multiple ways without copying.

regards, frank



More information about the Digitalmars-d mailing list