Make makeHouseholder more stable for cases where real(c0) is not very small (but the rest is).

This commit is contained in:
Christoph Hertzberg 2016-09-16 14:24:47 +02:00
parent 6edd2e2851
commit ce3557ca69

View File

@ -77,7 +77,7 @@ void MatrixBase<Derived>::makeHouseholder(
Scalar c0 = coeff(0);
const RealScalar tol = (std::numeric_limits<RealScalar>::min)();
if(tailSqNorm <= tol && numext::abs2(numext::imag(c0))<=tol)
if(tailSqNorm <= tol && numext::abs2(c0)<=tol)
{
tau = RealScalar(0);
beta = numext::real(c0);