Re: [eigen] Rotations and unit vectors |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
Hi Benoit,On Tue, May 7, 2013 at 4:47 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
But it's probably never OK to assert on anything that can depend on floating point values: that gives too finicky crashes (it doesn't help much that it's only #ifndef NDEBUG).
Could you explain why you think this is an issue? What kind of crashes are you referring to? When I hit an assert in a debug session, I get the exact line in my source code in which the error occurred.
If I were seeing something likeassert( abs(axis.squaredNorm() - 1) > eps); // just an examplemaybe even with a comment, there is hardly a more simple method to point me directly to the issue. Maybe that's different on other systems.I already like the idea of a loose threshold (e.g. sqrt(numeric_limits<double>::epsilon())) as suggested by Gael. Any code which triggers such a threshold e.g. due to numerical issues definitely has a problem and by quietly accepting these values we only delay the issue from surfacing.Regards,Hauke
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |