aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-01-08 14:23:30 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-01-08 14:23:30 +0000
commite2d2a7d2226b85569a9360b9738c15498fb454ac (patch)
tree0dd49dcd507b345fad813bc1d8832add653928a9
parentaf27fb75907728d97b7b4fec7aea8203f2fc095a (diff)
fix a bug -- bad read found by valgrind
-rw-r--r--Eigen/src/QR/SelfAdjointEigenSolver.h4
1 files changed, 3 insertions, 1 deletions
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