From e2d2a7d2226b85569a9360b9738c15498fb454ac Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Thu, 8 Jan 2009 14:23:30 +0000 Subject: fix a bug -- bad read found by valgrind --- Eigen/src/QR/SelfAdjointEigenSolver.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Eigen/src/QR/SelfAdjointEigenSolver.h') diff --git a/Eigen/src/QR/SelfAdjointEigenSolver.h b/Eigen/src/QR/SelfAdjointEigenSolver.h index a99a0b79b..1c9ad513d 100644 --- a/Eigen/src/QR/SelfAdjointEigenSolver.h +++ b/Eigen/src/QR/SelfAdjointEigenSolver.h @@ -357,10 +357,12 @@ static void ei_tridiagonal_qr_step(RealScalar* diag, RealScalar* subdiag, int st subdiag[k - 1] = c * subdiag[k-1] - s * z; x = subdiag[k]; - z = -s * subdiag[k+1]; if (k < end - 1) + { + z = -s * subdiag[k+1]; subdiag[k + 1] = c * subdiag[k+1]; + } // apply the givens rotation to the unit matrix Q = Q * G // G only modifies the two columns k and k+1 -- cgit v1.2.3