bug #1403: fix implicit scalar type conversion.

(grafted from 1bbcf19029ea3ac5493c3511807daa53fcde9e90
)
This commit is contained in:
Gael Guennebaud 2017-06-09 14:44:02 +02:00
parent 7a0a9581b5
commit 316969d839

View File

@ -556,7 +556,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) {