Re: [eigen] alpha6!

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


> 
> > My only issue is the usage of the operator Matrix3f()
> in
> > AngleAxis and Quaterion and operator Scalar() and
> others in Rotation2d. The
> > toMatrix() is clearer and less error prone IMHO.
> 
> As you can see in the code,
> 
>   operator Matrix3 () const { return toRotationMatrix(); }
> 
> the method you're asking for is named
> toRotationMatrix(). Do you think then 
> that it is a bad thing to also have the conversion
> operator? I can't really 
> see how it could be dangerous. One can also discuss whether
> it is better to 
> have an operator like this or a Matrix constructor. I
> don't really know... 
> this is Gael's work btw.
> 

I just caution against operator ...() because I've run into several situations where it causes bugs. I prefer explicit casting because it's more obvious (for you and the compiler) what's going on.

Cheers
Ben



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/