Re: [eigen] Rotations and unit vectors |

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

*To*: eigen <eigen@xxxxxxxxxxxxxxxxxxx>*Subject*: Re: [eigen] Rotations and unit vectors*From*: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>*Date*: Tue, 7 May 2013 10:47:03 -0400*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=k9h6NEJPoksi+vBbFHotZ32l0rf5XW7H3A/HATOCMWA=; b=u61UYW2yqaBZ1BhyKffA5M55CHDSuR+VHHFvSXW8Q36+deYO+0jsyNz05JcPUvoA0I M+DBz36mYHiP3UCKZnVsmdDG1jGTy/59/f7gvQKBQNtHh2PQ2aPac3ljByr96Zrncnti +TTupa1FTSxWhQVVP+m4lH468u/tvPNzD89W7op5lnklJ6Awde8NYRXXsoZbKhJowV2g RmgiRoL/r7H/XTQtYc8VjPVPbc/GiIkoNmznBCuYoelIcWuYImRi4/M9/1xBrGZb6sce H79gGmt1t3hzPrCRoOQSfQKlIWbDWQa4ZCWWSJqX2hU2+cr+X9Rl+Z901aY9VylrBX9D tdbA==

I agree with Hauke that this deserves checking, and it should probably be checked by default in debug builds, otherwise people will just not think of enabling the right preprocessor switch.

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).

You would still have to use a quite large tolerance to avoid this kicking in when it's not wanted... do we still have the 'dummy' precision values? That would be a decent choice.

NaN helps debugging in 2 ways:

- it's particularly obvious that something went wrong;

- you can turn on FP signals, so you could catch the first such error in your debugger.

Benoit

2013/5/7 Robert Lupton the Good <rhl@xxxxxxxxxxxxxxxxxxx>

Should we be using assert for user error? It's generally used to diagnose things that are impossible such as constraint violations or bugs. If it weren't for performance I'd propose an exception (within an #if !defined(NDEBUG) ... #endif block) that the user can catch.

R

P.S. Yes, you can use signal to catch SIGABRT

**Follow-Ups**:**Re: [eigen] Rotations and unit vectors***From:*Hauke Heibel

**Re: [eigen] Rotations and unit vectors***From:*Andreas Keil

**References**:**[eigen] Rotations and unit vectors***From:*Hauke Heibel

**Re: [eigen] Rotations and unit vectors***From:*Robert Lupton the Good

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Rotations and unit vectors** - Next by Date:
**Re: [eigen] Rotations and unit vectors** - Previous by thread:
**Re: [eigen] Rotations and unit vectors** - Next by thread:
**Re: [eigen] Rotations and unit vectors**

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