I've put the beginnings of my matrix-vector library up on github
(between swizzling, generalising to N dimensions and making use of
static foreach this project quickly turned from a cleanup to a rewrite).
You can find it here.
http://github.com/gcharnock/phoboslinalgebra
Some highlights so fa
On Sun, 25 Apr 2010 23:17:10 -0300, Gareth Charnock
wrote:
I've put the beginnings of my matrix-vector library up on github
(between swizzling, generalising to N dimensions and making use of
static foreach this project quickly turned from a cleanup to a rewrite).
You can find it here.
ht
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 rejec
Gareth Charnock:
>http://github.com/gcharnock/phoboslinalgebra
I think that a single module is better. If seen fitting, some functionality can
be moved inside other already present modules of Phobos.
The module will need a good amount of unit tests.
In the code I see no point in calling functio
You can do performance benchmarks compared to the tinyvector module here, for
D1:
http://www.fantascienza.net/leonardo/so/libs_d.zip
It comes from a performance tuning for DMD.
Bye,
bearophile
> The semantics of transpose/transposed can be like in Python: the transpose
> works in-place, transposed creates a new matrix.
That's what I do, with normalize/normalized too.
I'm not sure how your static foreach is actually static.
I think static foreach is a very good idea to minimize speed difference between
debug and release versions (i know one shouldn't ship debug version, but
sometimes you have to)...
> //Single element access does not require opDispatch
> wr
#ponce:
> I'm not sure how your static foreach is actually static.
It's a foreach on:
template TypeNuple(T, size_t n) {
static if(n == 0) {
alias TypeTuple!() TypeNuple;
}
else {
alias TypeTuple!(T,TypeNuple!(T, n-1)) TypeNuple;
}
}
So with the current D it's a s
I need a better name for ArgList. It originally made sense because
because I assumed I be using the tuple like this:
this(ArgList argList)
But then I ended up using it in a load of static foreaches.
I think it would be useful to actually be able to say "static foreach"
so that readers (and wri
Gareth Charnock:
> I think it would be useful to actually be able to say "static foreach"
> so that readers (and writers) of the code know for sure what's going on.
> I seem to remember you starting a thread on that very matter.
http://d.puremagic.com/issues/show_bug.cgi?id=4085
Bye,
bearophil
On Mon, 26 Apr 2010 03:46:47 -0300, Gareth Charnock
wrote:
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
Robert Jacques:
> - Element wise *, etc are important operators that you need to cleanly
> support. Design-wise, since we can't do Matlab style operators, I prefer
> */+- to be element wise,
But keep in mind in D the built-in array ops always require the [].
Bye,
bearophile
On Mon, 26 Apr 2010 13:16:02 -0300, bearophile
wrote:
Robert Jacques:
- Element wise *, etc are important operators that you need to cleanly
support. Design-wise, since we can't do Matlab style operators, I prefer
*/+- to be element wise,
But keep in mind in D the built-in array ops always
Robert Jacques:
> Yes, but emulating that behavior is difficult. And array ops are still
> buggy and broken to the degree of not being usable. In theory you
> shouldn't need to define a small vector or matrix in D: fixed size arrays
> are value types, array op support and free functions as me
- Element wise *, etc are important operators that you need to cleanly
support. Design-wise, since we can't do Matlab style operators, I prefer
*/+- to be element wise, and then use dot/cross/solve for matrix ops.
This seems to avoid the confusion of as having some ops be matrix style
and some
bearophile wrote:
Gareth Charnock:
http://github.com/gcharnock/phoboslinalgebra
I think that a single module is better. If seen fitting, some functionality can
be moved inside other already present modules of Phobos.
The module will need a good amount of unit tests.
In the code I see no poi
On Mon, 26 Apr 2010 18:02:53 -0300, Gareth Charnock
wrote:
- Element wise *, etc are important operators that you need to cleanly
support. Design-wise, since we can't do Matlab style operators, I
prefer */+- to be element wise, and then use dot/cross/solve for matrix
ops. This seems to avo
Gareth Charnock wrote:
> PS: Okay so I just had a looked at the matrix and vector classes in
> Ogre3D and irrlicht. Looks like they both define v*v as element wise
> multiplication but m*m is matrix multiplication. That just seems even
> more inconsistent.
Eigen (http://eigen.tuxfamily.org
> 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 fee
Jérôme M. Berger wrote:
Gareth Charnock wrote:
PS: Okay so I just had a looked at the matrix and vector classes in
Ogre3D and irrlicht. Looks like they both define v*v as element wise
multiplication but m*m is matrix multiplication. That just seems even
more inconsistent.
Eigen (http:/
On Thu, 29 Apr 2010 19:16:49 -0400, Gareth Charnock
wrote:
Jérôme M. Berger wrote:
Gareth Charnock wrote:
PS: Okay so I just had a looked at the matrix and vector classes in
Ogre3D and irrlicht. Looks like they both define v*v as element wise
multiplication but m*m is matrix multiplication.
Robert Jacques wrote:
> On Thu, 29 Apr 2010 19:16:49 -0400, Gareth Charnock
> wrote:
>
>> Jérôme M. Berger wrote:
>>> Gareth Charnock wrote:
PS: Okay so I just had a looked at the matrix and vector classes in
Ogre3D and irrlicht. Looks like they both define v*v as element wise
mult
On Fri, 30 Apr 2010 17:23:33 -0400, Jérôme M. Berger
wrote:
Robert Jacques wrote:
On Thu, 29 Apr 2010 19:16:49 -0400, Gareth Charnock
wrote:
Jérôme M. Berger wrote:
Gareth Charnock wrote:
PS: Okay so I just had a looked at the matrix and vector classes in
Ogre3D and irrlicht. Looks like t
23 matches
Mail list logo