diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-01-08 14:23:30 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-01-08 14:23:30 +0000 |
commit | e2d2a7d2226b85569a9360b9738c15498fb454ac (patch) | |
tree | 0dd49dcd507b345fad813bc1d8832add653928a9 | |
parent | af27fb75907728d97b7b4fec7aea8203f2fc095a (diff) |
fix a bug -- bad read found by valgrind
-rw-r--r-- | Eigen/src/QR/SelfAdjointEigenSolver.h | 4 |
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 |