Re: [eigen] Cumbersome syntax questions/feedback

[ Thread Index | Date Index | More Archives ]

Hi Gael,

On Sun, 2009-08-16 at 14:35 +0200, Gael Guennebaud wrote:
> > What's the reason that Transform3f::inverse() returns a matrix type
> > rather than a transform type?
> yes, that's weird that Transform::inverse() returns a Matrix and not a
> Transform. This also surprised myself recently while it is probably me
> who right it. Unless someone can refresh why it should return a
> Matrix, I'm willing to change that (in both branches)

Good news. I guess you might want to leave it as it is in the 2.0.x
branch though, as returning a Transform type breaks existing code.

> > Any special reason that Translation3f and friends doesn't have a
> > matrix() method? Or am I doing something plain wrong here?
> hm, here you should really use the Transform class. We cannot have a
> .matrix() class because we don't know what the user want. E.g, for
> Translation shall we return a Dim+1 x Dim+1 matrix, or a compact Dim x
> Dim+1 matrix ? For Scaling we could also return a Dim x Dim matrix.
> Furthermore, Transform internally stores a Matrix, so the matrix()
> function is free, while converting a Translation to a Matrix is not
> free and costly to use. For instance, Transform3f * Translation3f is
> compiled as a Matrix33 * Vector3 product that is something the
> compiler cannot do by itself.

Makes sense, thanks for the explanation.


Attachment: signature.asc
Description: This is a digitally signed message part

Mail converted by MHonArc 2.6.19+