Re: [eigen] Rotations and unit vectors

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


Hi,

On Tue, May 7, 2013 at 12:07 PM, Gael Guennebaud <gael.guennebaud@xxxxxxxxx> wrote:
1 - performance drop without -DNDEBUG (probably acceptable)
2 - the axis vector can be changed with the .axis() method. Therefore
we should assert for unit vectors anytime it is assumed to be so. This
concerns many more functions.

I understand these issues but personally, I am more concerned about the performance in release mode and prefer to have errors risen when I am using a library in the wrong way in debug mode.

The issue about mutating functions is tricky. We have it in quite a few places in the Geometry module, e.g. Transform::linear()/matrix(). These mutating functions pretty much break the encapsulation of the classes. Fixing these (as opposed to removing them) is a little bit more complicated since the only solution I see is the introduction of proxy objects which would do the checking which already sounds messy. :)
 
3 - Which tolerance? Shall we strictly enforce that
axis.normalized()==axis? shall we tolerate some epsilon??

Maybe epsilon could be computed as the upper bound of the error which could be imposed by calling axis.normalized() but I am not sure - probably this error is depending on the magnitude of the original axis. Furthermore, I would compare axis.squaredNorm() as opposed to individual vector components.

Coming back to the mutating functions, I think having a few error checks is better than nothing for the beginning.

Regards,
Hauke


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