3D Math Data structures/SIMD

Janice Caron caron800 at googlemail.com
Fri Dec 21 02:58:20 PST 2007


On 12/21/07, Lukas Pinkowski <Lukas.Pinkowski at web.de> wrote:
> Well, as for the typenames, I guess something along
>
> v2f, v3f, v4f, m2f, m3f, m4f: vectors and matrices based on float
> v2d, v3d, v4d, m2d, m3d, m4d: vectors and matrices based on double
> v2r, v3r, v4r, m2r, m3r, m4r: vectors and matrices based on real
>
> Or vec2f instead of v2f, mat2f instead of m2f, a.s.o. Complex versions would
> be probably needed, too?

That's an awful lot of reserved words - especially when you take into
account the distinction between complex float, complex double, and ...
er ... the other one. :-) Also, I couldn't help but notice that all
your matrices seem to be square, and in general, they're not.

What's wrong with Vector!(3,float), Matrix!(4,4,real),
Matrix!(3,4,cdouble), etc.?

And as for API, well, the operator overloads should just do the
obvious thing (although I admit we lack dot-product and cross-product
operators, but if you used u*v for dot product and u.cross(v) for
cross product, I don't see anyone complaining).

In other words, it /should/ be a library feature.



More information about the Digitalmars-d mailing list