Re: [eigen] Changed behavior of jacobisvd

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



Hi,

no big deal as the third singular value is still numerically zero compared to the largest one, and I'm pretty sure that you can build examples exhibiting the opposite behavior. For the record, the precise changes at the origin of this change of behavior are in the computation of the 2x2 SVD:

old:

RealScalar u = d / t;
rot1..c() = RealScalar(1) / sqrt(RealScalar(1) + numext::abs2(u));
rot1.s() = rot1.c() * u;

new:

RealScalar t2d2 = numext::hypot(t,d);
rot1.c() = abs(t)/t2d2;
rot1.s() = d/t2d2;
if(t<RealScalar(0))
  rot1.s() = -rot1.s();

the old one is subject to underflow and overflow issues, and it does not pass our unit tests. I'm open to better suggestions for this portion of the code. Its purpose is to construct a rotation R such that R * M is symmetric (M being real and 2x2) with t and d as follows:
  t = m(0,0) + m(1,1);
 d = m(1,0) - m(0,1);

cheers,
gael

On Wed, Jun 3, 2015 at 9:28 PM, Rob Conde <rob.conde@xxxxxxxxxxxxxxxx> wrote:

I'm not sure if this is a sign of anything wrong, but I noticed the following change in updating from eigen 3.2.1 to 3.2.4 using Visual Studio 2013.

For the matrix:

1 2 3
0 0 0
7 8 9

JacobiSVD used to give 0 as the minimum singular value. Now it is 1.4079439049813084e-033

MATLAB and Wolfram Alpha give 0.



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