diff options
-rw-r--r-- | Eigen/src/Eigenvalues/EigenSolver.h | 1 | ||||
-rw-r--r-- | test/eigensolver_generic.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/Eigen/src/Eigenvalues/EigenSolver.h b/Eigen/src/Eigenvalues/EigenSolver.h index b3594655a..bd45d76ac 100644 --- a/Eigen/src/Eigenvalues/EigenSolver.h +++ b/Eigen/src/Eigenvalues/EigenSolver.h @@ -343,6 +343,7 @@ typename EigenSolver<MatrixType>::EigenvectorsType EigenSolver<MatrixType>::eige { // we have a real eigen value matV.col(j) = m_eivec.col(j).template cast<ComplexScalar>(); + matV.col(j).normalize(); } else { diff --git a/test/eigensolver_generic.cpp b/test/eigensolver_generic.cpp index 26bea9b44..8476f026d 100644 --- a/test/eigensolver_generic.cpp +++ b/test/eigensolver_generic.cpp @@ -61,6 +61,7 @@ template<typename MatrixType> void eigensolver(const MatrixType& m) VERIFY_IS_APPROX(a * ei1.pseudoEigenvectors(), ei1.pseudoEigenvectors() * ei1.pseudoEigenvalueMatrix()); VERIFY_IS_APPROX(a.template cast<Complex>() * ei1.eigenvectors(), ei1.eigenvectors() * ei1.eigenvalues().asDiagonal()); + VERIFY_IS_APPROX(ei1.eigenvectors().colwise().norm(), RealVectorType::Ones(rows).transpose()); VERIFY_IS_APPROX(a.eigenvalues(), ei1.eigenvalues()); EigenSolver<MatrixType> eiNoEivecs(a, false); |