Re: [eigen] Eigen appears to rock.

[ Thread Index | Date Index | More Archives ]

Quoting Thomas Vaughan <tevaughan@xxxxxxxxx>:

On Thu, Aug 21, 2008 at 8:37 AM,  <jacob@xxxxxxxxxxxxxxx> wrote:
Another argument against Point is that it means more types hence more
code instantiated for the same thing.

I think that it is not for the same thing.

It is not for the same thing conceptually, but it is the same thing computationally. Nobody would want to have the same compiled twice into his binaries, just because conceptually it's different. Even it we made Point call Vector's code or the other way around, as far as template instantiations are concerned it would be a separate type.

An important aspect in this discussion is that Eigen is based on expression templates -- otherwise indeed this problem wouldn't exist (but there would remain the other problems discussed by the others).

The fact that Point+Vector returns Point is actually an important
difference, because the returned Point transforms differently from the

But, this is already well taken care of by the Transform class. From a computational point of view, it makes more sense to have that difference on the side of the matrix transformation... by the way, even with a Point class we would still need a similar Transform class.

and the Point has a much smaller and different interface of
allowed operations.

Not so small... for example if you want to compute a barycenter, you need to do: (1-weight1)*point1+weight2*point2.... if you have to convert back and forth between point and vector, you kill performance. (I know the particular case (point1+point2)/2 is being discussed in the other mails, just showing that really most of the API is needed).


By using classes like these in my own code, it has actually helped me to
clarify thoughts in my own mind (and, I think, to keep my code more

I didn't realize that this method was called affine(). Why? To me, the
whole 4x4 matrix is an affine transformation (which means linear
transformation combined with translation) and the topleft 3x3 block is
the _linear_ part.  So, how about renaming affine() to linear() ?

I agree completely.  I suggested the same thing in my other message.

You guys are great to talk to.  Thanks for giving me some time.

Thomas E. Vaughan

There are only two kinds of people; those who accept dogma and know it,
and those who accept dogma and don't know it. - G.K. Chesterton

This message was sent using IMP, the Internet Messaging Program.

Mail converted by MHonArc 2.6.19+