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

Don Clugston dac at nospam.com.au
Tue Nov 20 03:05:19 PST 2007


No, I don't have the perfect Matrix. I just want to explore the question of 
whether it exists.
There are a plethora of C++ matrix libraries, all of which are far from perfect; 
they all involve trade-offs between various language limitations.
In particular, the usage of expression templates creates all kinds of evil.

Requirements:
1. Must be compatible with future multi-dimensional array syntax such as
double [7,5] m;
2. Must be theoretically capable of optimal performance.
3. Needs to support slices. This means we also need to support strided
vectors. Therefore we also need matrix slices, and matrix references.
Probably distinguishing between the T[] and T[new] concepts.
4. For storage we need packed, triangular, symmetric, banded, and sparse
matrix support. (Possibly even 'calculated' matrix support, for
user-defined matrix types which generate entries on-demand).
5. Can be generalized to tensors.
6. Nice error messages.

I now have enough experience with my BLADE library to be confident that all of 
these features can be achieved in existing D. In particular, the crucial 
requirement 2 can be completely decoupled from the others.

But, there are many requirements (dozens?) which are not on my brief list, and 
perhaps they cannot all be met simultaneously, even in theory. Yet I'm not 
convinced that it's impossible. What are the other requirements?



More information about the Digitalmars-d mailing list