bug #1403: fix implicit scalar type conversion.

This commit is contained in:
Gael Guennebaud 2017-06-09 14:44:02 +02:00
parent ba5cab576a
commit 1bbcf19029

View File

@ -555,7 +555,7 @@ void ColPivHouseholderQR<MatrixType>::computeInPlace()
if (m_colNormsUpdated.coeffRef(j) != 0) {
RealScalar temp = abs(m_qr.coeffRef(k, j)) / m_colNormsUpdated.coeffRef(j);
temp = (RealScalar(1) + temp) * (RealScalar(1) - temp);
temp = temp < 0 ? 0 : temp;
temp = temp < 0 ? RealScalar(0) : temp;
RealScalar temp2 = temp * numext::abs2<RealScalar>(m_colNormsUpdated.coeffRef(j) /
m_colNormsDirect.coeffRef(j));
if (temp2 <= norm_downdate_threshold) {