Re: [eigen] Householder.h: ::min() and operator<= |

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

*To*: eigen <eigen@xxxxxxxxxxxxxxxxxxx>*Subject*: Re: [eigen] Householder.h: ::min() and operator<=*From*: Rasmus Larsen <rmlarsen@xxxxxxxxxx>*Date*: Thu, 8 Sep 2016 09:16:32 -0700*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=yujrBjA2upoltSjDsjV3sNK/kijZ2koOOo2JXRBrcIA=; b=AlZI1bCoE5nIo3ADqKZjZi80pgnF40GasLS6nNNj0iz5zcuWy21An+MAwTdkkGhDcp OlGS4O8alHZu1Zd6NLaXtXRV23yS1IwBVkSHmCBr5XZa2qDjVB2+JrYhyNylWX3HnAd5 UFbqj1mLqU9JOvSpTFXLUBv4cyZywAy2RY85sVb8dgvEMMw1q5jfI4BDjuTJ2kFLVPRH 3lum1vkpyXZyxh82rqOyH6sZhhBlGG98YE83fUXHmyFYeZkdpqymEeuRI7y6Frvf5WLq 5iMvdIAR/zjnHL7p96RLUwVb2RboFbUQdQdWYiAB89jVt/TtMzYawgtB/nIOVgxcW/oq tkEg==

For floating point types, min() is the smallest normalized value (1.175494e-38 for float), while epsilon() is the smallest value such that 1+epsilon() > 1 (1.192093e-07 for float).

On Thu, Sep 8, 2016 at 9:04 AM, Peter <list@xxxxxxxxxxxxxxxxx> wrote:

Dear All,

I'm currently investigating, why the diagonalization using my self defined custom types doesn't work

and stumpled over the following issues in Householder.h:

line 78: const RealScalar tol = (std::numeric_limits<RealScalar>::min)();

According to gdb std::numeric_limits<RealScalar>::min just calls the default constructor in my case,

which returns a non-initialised object.

Seems like one should define std::numeric_limits<RealScalar>::min for user defined types.

But that's asking for trouble. Wasn't the idea of NumTraits<TpFloat>::epsilon() to provide this information?

line 80: if(tailSqNorm <= tol && numext::abs2(numext::imag(c0))<=tol)

I have a little problem with the '<=' operator here. Here it used to measure the difference from zero,

more precisely, whether it is safe to divide by beta later. This could be a problem for user defined types

which consist of tuples of arithmetic types, e.g. {z1, z2}. Ordering them by first by z1, and if that component agrees

with the then one orders by z2 will conflict with the intention of line 80,

in case it is safe to divide by { 0, z2>epsilon }.

However I have no simple suggestion to that, and maybe it's a too constructed example.

Out of curiosity, is there an advantage of using householder for a 2x2 matrix, as Eigen::SelfAdjointEigenSolver does,

instead of just performing a Jacobi rotation?

Best regards,

Peter

**Follow-Ups**:

**References**:**[eigen] Householder.h: ::min() and operator<=***From:*Peter

**Messages sorted by:**[ date | thread ]- Prev by Date:
**[eigen] Householder.h: ::min() and operator<=** - Next by Date:
**Re: [eigen] Householder.h: ::min() and operator<=** - Previous by thread:
**[eigen] Householder.h: ::min() and operator<=** - Next by thread:
**Re: [eigen] Householder.h: ::min() and operator<=**

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