From 476beed7f837cbed9abc401f685c1882936fa959 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 22 Jun 2015 16:51:45 +0200 Subject: bug #1017: apply Christoph's patch preventing underflows in makeHouseholder --- Eigen/src/Householder/Householder.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Eigen/src/Householder') 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::makeHouseholder( RealScalar tailSqNorm = size()==1 ? RealScalar(0) : tail.squaredNorm(); Scalar c0 = coeff(0); + const RealScalar tol = (std::numeric_limits::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); -- cgit v1.2.3