diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-09-04 10:05:22 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-09-04 10:05:22 +0200 |
commit | a7ed998d523287e790142f4d3ff3d7f8e37e4d17 (patch) | |
tree | 19a00fa66be473f9da802d57b4a2168ea0246481 /Eigen | |
parent | 3fbf71d6b95c11729c673d11aa6d193faae4589e (diff) |
bug fix in novel makeGivens for real
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Jacobi/Jacobi.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Eigen/src/Jacobi/Jacobi.h b/Eigen/src/Jacobi/Jacobi.h index 7fd57ed5f..3905f4d8f 100644 --- a/Eigen/src/Jacobi/Jacobi.h +++ b/Eigen/src/Jacobi/Jacobi.h @@ -233,7 +233,7 @@ void PlanarRotation<Scalar>::makeGivens(const Scalar& p, const Scalar& q, Scalar m_s = q<Scalar(0) ? Scalar(1) : Scalar(-1); if(r) *r = ei_abs(q); } - else if(p>q) + else if(ei_abs(p) > ei_abs(q)) { Scalar t = q/p; Scalar u = ei_sqrt(Scalar(1) + ei_abs2(t)); @@ -250,7 +250,7 @@ void PlanarRotation<Scalar>::makeGivens(const Scalar& p, const Scalar& q, Scalar if(q<Scalar(0)) u = -u; m_s = -Scalar(1)/u; - m_c = t * m_s; + m_c = -t * m_s; if(r) *r = q * u; } |