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

Neal Becker ndbecker2 at gmail.com
Tue Nov 20 10:10:23 PST 2007


I'm fond of blitz++ approach:

1.  An array is a view of memory, with dimension, strides, and (possibly)
non-zero bases.  This design allows multiple, independent views of the same
memory.

2. Memory allocation itself is ref counted.

Benefits: 

* This design allows a slice, or view to be an lvalue.
* Plays nicely with python - semantics are similar to numpy/numeric.
  specifically, I can return a view as a python object.  Python can hold it,
and ref counting keeps the underlying memory alive.
* Generalized views.  For example real(complex_array) is a view, and is an
lvalue.



More information about the Digitalmars-d mailing list