3D Math Data structures/SIMD

Janice Caron caron800 at googlemail.com
Sat Dec 22 01:12:25 PST 2007


If you wanted to go even more general, you could go beyond std.matrix
and head into the murky waters of std.tensor.

Tensors are a generalisation of the progression: scalar, vector, matrix, ....

Think of a scalar as a zero-dimensional array; a vector as a one
dimentional array, and a matrix as a two dimentional array. A scalar
is a tensor with rank zero; a vector is a tensor with rank one; a
matrix is a tensor with rank two. This completely generalises for
tensors of arbitrary (non negative integer) rank.

(There is a complication though, in that you have to distinguish
between contravariant and covariant indeces)

If tensor mathematics were implemented, vectors and matrices could be
trivially implemented in terms of tensors.

See http://mathworld.wolfram.com/Tensor.html

(That might be going a bit further than people are ever going to need
though! :-) )



More information about the Digitalmars-d mailing list