mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-22 17:49:36 +08:00
fix a bug -- bad read found by valgrind
This commit is contained in:
parent
af27fb7590
commit
e2d2a7d222
@ -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;
|
subdiag[k - 1] = c * subdiag[k-1] - s * z;
|
||||||
|
|
||||||
x = subdiag[k];
|
x = subdiag[k];
|
||||||
z = -s * subdiag[k+1];
|
|
||||||
|
|
||||||
if (k < end - 1)
|
if (k < end - 1)
|
||||||
|
{
|
||||||
|
z = -s * subdiag[k+1];
|
||||||
subdiag[k + 1] = c * subdiag[k+1];
|
subdiag[k + 1] = c * subdiag[k+1];
|
||||||
|
}
|
||||||
|
|
||||||
// apply the givens rotation to the unit matrix Q = Q * G
|
// apply the givens rotation to the unit matrix Q = Q * G
|
||||||
// G only modifies the two columns k and k+1
|
// G only modifies the two columns k and k+1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user