Small vector and matrix proposed for phobos2 now on github

Gareth Charnock gareth.tpc at gmail.com
Sun Apr 25 23:46:47 PDT 2010


Thanks. To quickly answer this:

 > - The version I'm seeing on github doesn't seem to have all the features
 > you're referencing (i.e. v*v). Why are some ops limited to */ and 
other +-?

It was quite late (3am) when I typed up that email. I'm sorry if I got 
the ops wrong. v*v was actually rejected in favour of dot(v,v). Unless 
I've made another mistake the implemented operators are:

v*s    v/s    v*=s
v/=s   v+v    v-v
v+=v   v-=v   m+m
m-m    m*m    m*v

(where v is a vector, m a matrix, s a scalar)

The reason the feature set is very limited is I wanted to get feedback 
before implementing a large set of features and then having to change 
things. The idea was to implement just enough so that it would be clear 
where I was going. For example, I wasn't aware that compile time foreach 
was a bad way to unroll loops (perhaps I should build a mixin string?).


More information about the Digitalmars-d-announce mailing list