aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-11-02 10:46:40 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-11-02 10:46:40 +0100
commit979431b9871bde9cee6c598ce9615a729d39e330 (patch)
tree404bbfdb14644df3d3dfe4aaeeaeb2209ac35e7e /Eigen
parent5ba19a53a6eb68c0bf1d2b531fe7fbffcca39929 (diff)
fix #66 : upper triangular checks in ComplexSchur
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/Eigenvalues1
-rw-r--r--Eigen/src/Eigenvalues/ComplexSchur.h16
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;
}