3D Math Data structures/SIMD

"Jérôme M. Berger" jeberger at free.fr
Sat Dec 22 02:08:08 PST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Janice Caron wrote:
> On 12/22/07, Janice Caron <caron800 at googlemail.com> wrote:
>> It's not obvious to me why the elements should be x, y, z and w. How
>> does this generalize? What's the rule? Is it "Start at 'x', proceed up
>> the English alphabet till you get to 'z', then after that work
>> backwards from 'w' down to 'a'? I don't get it. Seems like an odd and
>> arbitrary rule, and also totally English-centric. (Well, we wouldn't
>> want to use the Cyrillic alphabet would we? That's foreign!)
> 
> I withdraw that last remark. It was uncalled for. I was trying to
> posit that there is nothing special about the English alphabet, and
> that all Unicode letters are acceptable as identifier names, but I
> didn't express that very well, so if I caused any offense, I
> apologise.
> 
> I still don't see how the rule generalises to N elements though, and
> so my question about the rule is still open.

	I guess, he meant to say that .x, .y .z and .w could be used as an
alternative (and in addition) to [] for small vectors. However, the
problem is that the choice of letters is application-dependent:
 - 2D vectors often use (u, v) as well as (x, y);
 - 4D vectors often use "t" for the 4th component instead of "w".

	Something that could be nice:

Vector!(double[3], "abc") vec;

	The "abc" string would be optional, but if given it would need to
be the same size as the vector and it would tell the compiler that
we want to be able to access the elements with vec.a, vec.b and
vec.c in addition to vec[i]. This would allow us to specify what
letters we want to be able to use for any given application.

		Jerome
- --
+------------------------- Jerome M. BERGER ---------------------+
|    mailto:jeberger at free.fr      | ICQ:    238062172            |
|    http://jeberger.free.fr/     | Jabber: jeberger at jabber.fr   |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFHbOIId0kWM4JG3k8RAvcKAKC0r3Xu90Ttie9zxQdZEnQz6uJByQCfZVw3
KpaUV5eVt6cUEdJRB/kZcX4=
=jGHS
-----END PGP SIGNATURE-----



More information about the Digitalmars-d mailing list