From 7b34b5f6f98115efbda9d127378aea5d403a4905 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 24 Jul 2012 18:19:56 +0200 Subject: do not apply plane rotation when it is exactly the identity --- Eigen/src/Jacobi/Jacobi.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'Eigen/src/Jacobi') diff --git a/Eigen/src/Jacobi/Jacobi.h b/Eigen/src/Jacobi/Jacobi.h index a9c17dcdf..7eb19a023 100644 --- a/Eigen/src/Jacobi/Jacobi.h +++ b/Eigen/src/Jacobi/Jacobi.h @@ -207,7 +207,6 @@ void JacobiRotation::makeGivens(const Scalar& p, const Scalar& q, Scalar template void JacobiRotation::makeGivens(const Scalar& p, const Scalar& q, Scalar* r, internal::false_type) { - if(q==Scalar(0)) { m_c = p(j.c()); - const Packet ps = pset1(j.s()); + const Packet pc = pset1(c); + const Packet ps = pset1(s); conj_helper::IsComplex,false> pcj; for(Index i=0; i(j.c()); - const Packet ps = pset1(j.s()); + const Packet pc = pset1(c); + const Packet ps = pset1(s); conj_helper::IsComplex,false> pcj; Scalar* EIGEN_RESTRICT px = x; Scalar* EIGEN_RESTRICT py = y; @@ -405,8 +409,8 @@ void /*EIGEN_DONT_INLINE*/ apply_rotation_in_the_plane(VectorX& _x, VectorY& _y, { Scalar xi = *x; Scalar yi = *y; - *x = j.c() * xi + conj(j.s()) * yi; - *y = -j.s() * xi + conj(j.c()) * yi; + *x = c * xi + conj(s) * yi; + *y = -s * xi + conj(c) * yi; x += incrx; y += incry; } -- cgit v1.2.3