mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-13 20:26:03 +08:00
Fix bug #540: SelfAdjointEigenSolver improperly used the upper triangular part to extract the scaling factor.
This commit is contained in:
parent
7262cf783c
commit
761b3bbb69
@ -409,9 +409,10 @@ SelfAdjointEigenSolver<MatrixType>& SelfAdjointEigenSolver<MatrixType>
|
|||||||
MatrixType& mat = m_eivec;
|
MatrixType& mat = m_eivec;
|
||||||
|
|
||||||
// map the matrix coefficients to [-1:1] to avoid over- and underflow.
|
// map the matrix coefficients to [-1:1] to avoid over- and underflow.
|
||||||
RealScalar scale = matrix.cwiseAbs().maxCoeff();
|
mat = matrix.template triangularView<Lower>();
|
||||||
|
RealScalar scale = mat.cwiseAbs().maxCoeff();
|
||||||
if(scale==RealScalar(0)) scale = RealScalar(1);
|
if(scale==RealScalar(0)) scale = RealScalar(1);
|
||||||
mat = matrix / scale;
|
mat.template triangularView<Lower>() /= scale;
|
||||||
m_subdiag.resize(n-1);
|
m_subdiag.resize(n-1);
|
||||||
internal::tridiagonalization_inplace(mat, diag, m_subdiag, computeEigenvectors);
|
internal::tridiagonalization_inplace(mat, diag, m_subdiag, computeEigenvectors);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user