aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Householder
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2015-06-22 16:51:45 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2015-06-22 16:51:45 +0200
commit476beed7f837cbed9abc401f685c1882936fa959 (patch)
treec313b87935c46d5130708b6168a98d16fc633f8b /Eigen/src/Householder
parent9fc1c921377df09684cf3184daf527009276f78a (diff)
bug #1017: apply Christoph's patch preventing underflows in makeHouseholder
Diffstat (limited to 'Eigen/src/Householder')
-rw-r--r--Eigen/src/Householder/Householder.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h
index 32112af9b..4c1f499a1 100644
--- a/Eigen/src/Householder/Householder.h
+++ b/Eigen/src/Householder/Householder.h
@@ -75,8 +75,9 @@ void MatrixBase<Derived>::makeHouseholder(
RealScalar tailSqNorm = size()==1 ? RealScalar(0) : tail.squaredNorm();
Scalar c0 = coeff(0);
+ const RealScalar tol = (std::numeric_limits<RealScalar>::min)();
- if(tailSqNorm == RealScalar(0) && numext::imag(c0)==RealScalar(0))
+ if(tailSqNorm <= tol && numext::abs2(numext::imag(c0))<=tol)
{
tau = RealScalar(0);
beta = numext::real(c0);