The Matrix to end all Matrix classes (Let's dream!)
Dan
murpsoft at hotmail.com
Tue Nov 20 15:47:36 PST 2007
Neal Becker Wrote:
> 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.
An array already has a clear definition. Anyone attempting to redefine terms doesn't have enough familiarity with them. Arrays are 1 dimensional segments of discrete information.
> 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.
Recreating the Python square wheel in D won't serve the needs of very many people.
Especially if there's no value added.
Can we please get over the cryptolect bullshit and talk straight?
D's slices already perform 90% of the stuff we want in order to achieve a Matrix. You more or less just want a standard library that lets you do it, right?
D let's us use the sugar coated format:
myArray.method() if the method is written to take a myArray as the first argument.
Regards,
Dan
More information about the Digitalmars-d
mailing list