Small vector and matrix proposed for phobos2 now on github

#ponce spam at spam.spam
Tue Apr 27 10:38:10 PDT 2010


> As for principal of least surprise, lots of libraries op  
> for using array-wise * and v.dot(v), including (IIRC) all of the various  
> GPU shading/compute languages.


In GLSL, vector * vector is component-wise 
      but  matrix * vector is not
             matrix * matrix is not,

and it feels very natural.

In HLSL, * is always component-wise and you have to use mul(a, b) to use the product... I don't buy it.

Gareth is right, element-wise multiplication for matrices is near to useless, whereas it's handy for vectors.


More information about the Digitalmars-d-announce mailing list