Re: [eigen] RotationBase times DiagonalMatrix

[ Thread Index | Date Index | More Archives ]


first I want to say that I almost completely +1 Christoph's post.

On Fri, Sep 23, 2011 at 7:31 PM, Gael Guennebaud
<gael.guennebaud@xxxxxxxxx> wrote:
> The real
> question is do we want that Translation to Transform conversion
> happens being the scene. At a first glance I would say no, and that
> why I put these explicit keywords. I remember that was suggested by
> another user, so I'm not the only one who thought like that.

For me the question is why we would want to prohibit this implicit
conversion as long as the *is a* relation is not compromised.
Following Christoph's reasoning, a Translation is a Transform  and
IMHO that is what should matter.

OTOH, one might argue that with such an implicit conversion the memory
requirements increase from Dim to 2*(Dim+1) for translations as well
as scaling types.

But then I am not sure whether that should be a reason to prohibit
such a conversion.

> Moreover, I
> see that the conversion ctor from Transform to Transform of different
> kinds (e.g., Affine to Projective) is not explicit.

IIRC, we check the validity of these conversions at compile time. If
we don't do it yet, it is a trivial static assert. In the end will not
break the *is a* relation.

> I'd still keep it for the ctor from EigenBase.

Absolutely, the perfect example where you really want the explicit keyword.

> We could add a non explicit one from DiagonalMatrix then.

And here is the only point where I am not sure. In my eyes the only
reason is the increased memory requirement but that's the same as for
Translations. Following the *is a* reasoning of Christoph, the
conversion is fine as long the Transform is not an Isometry and I
think we could prevent this conversion once again with a

- Hauke

Mail converted by MHonArc 2.6.19+