diff options
-rw-r--r-- | Eigen/Eigenvalues | 1 | ||||
-rw-r--r-- | Eigen/src/Eigenvalues/ComplexSchur.h | 16 |
2 files changed, 10 insertions, 7 deletions
diff --git a/Eigen/Eigenvalues b/Eigen/Eigenvalues index 9a6443f39..8c6841549 100644 --- a/Eigen/Eigenvalues +++ b/Eigen/Eigenvalues @@ -8,6 +8,7 @@ #include "Cholesky" #include "Jacobi" #include "Householder" +#include "LU" // Note that EIGEN_HIDE_HEAVY_CODE has to be defined per module #if (defined EIGEN_EXTERN_INSTANTIATIONS) && (EIGEN_EXTERN_INSTANTIATIONS>=2) diff --git a/Eigen/src/Eigenvalues/ComplexSchur.h b/Eigen/src/Eigenvalues/ComplexSchur.h index 0534715c4..a25af342d 100644 --- a/Eigen/src/Eigenvalues/ComplexSchur.h +++ b/Eigen/src/Eigenvalues/ComplexSchur.h @@ -167,10 +167,11 @@ void ComplexSchur<MatrixType>::compute(const MatrixType& matrix, bool skipU) //locate the range in which to iterate while(iu > 0) { - d = ei_norm1(m_matT.coeffRef(iu,iu)) + ei_norm1(m_matT.coeffRef(iu-1,iu-1)); - sd = ei_norm1(m_matT.coeffRef(iu,iu-1)); + d = ei_norm1(m_matT.coeff(iu,iu)) + ei_norm1(m_matT.coeff(iu-1,iu-1)); + sd = ei_norm1(m_matT.coeff(iu,iu-1)); - if(sd >= eps * d) break; // FIXME : precision criterion ?? + if(!ei_isMuchSmallerThan(sd,d,eps)) + break; m_matT.coeffRef(iu,iu-1) = Complex(0); iter = 0; @@ -187,13 +188,14 @@ void ComplexSchur<MatrixType>::compute(const MatrixType& matrix, bool skipU) } il = iu-1; - while( il > 0 ) + while(il > 0) { // check if the current 2x2 block on the diagonal is upper triangular - d = ei_norm1(m_matT.coeffRef(il,il)) + ei_norm1(m_matT.coeffRef(il-1,il-1)); - sd = ei_norm1(m_matT.coeffRef(il,il-1)); + d = ei_norm1(m_matT.coeff(il,il)) + ei_norm1(m_matT.coeff(il-1,il-1)); + sd = ei_norm1(m_matT.coeff(il,il-1)); - if(sd < eps * d) break; // FIXME : precision criterion ?? + if(ei_isMuchSmallerThan(sd,d,eps)) + break; --il; } |