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*: Hauke Heibel <hauke.heibel@xxxxxxxxx>*Date*: Tue, 7 May 2013 13:12:41 +0200*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=ZvSjgqlqIMRadzBexmlgJbibKTquU3FtI6ue/26IcsQ=; b=V3Co3r4QLK5U4PcykaP31Y/fTPSL5lU4x9jhVjievp3pfp7mwKkXAc+5lBWrQEde20 bH9w8gpaaMopGI9VuJJO6NXliGQNqjUV2QVcKi31fafNDXrmmtwkFuHHL/oFfMgnE0AO GakFo/+c7tByGDtWEA+49wMwIcMmWmxkQdlNinScidnUXY+jMAaPHqMv0qDm7XEF+qEF O9BfvuNLB/6dXPNK2mHc7UbXR7Y1x1Dl6JAMFvcUAgdhFQ2XUBg46WC+pxj2o60mVXoo 0ORUEawcgvi5IPhgBkLB7q9w6F6qCL0dvuNLlWo/FmpsXJK1y/O1oC14twNkqCThQ58d dhjw==

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

**Follow-Ups**:**Re: [eigen] Rotations and unit vectors***From:*Christoph Hertzberg

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

**Re: [eigen] Rotations and unit vectors***From:*Gael Guennebaud

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Rotations and unit vectors** - Next by Date:
**Re: [eigen] Named branches** - 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/ |