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

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


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










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