fix implicit scalar conversions (needed to support fancy scalar types, see bug #276)

(transplanted from d61f1eae804a5dc4924f167c00fbde31c1bef7ea)
This commit is contained in:
David H. Bailey
2011-05-23 11:20:13 +02:00
parent e3a521be6b
commit b3c3627c72
8 changed files with 27 additions and 27 deletions

View File

@@ -387,7 +387,7 @@ ColPivHouseholderQR<MatrixType>& ColPivHouseholderQR<MatrixType>::compute(const
for(Index k = 0; k < cols; ++k)
m_colSqNorms.coeffRef(k) = m_qr.col(k).squaredNorm();
RealScalar threshold_helper = m_colSqNorms.maxCoeff() * internal::abs2(NumTraits<Scalar>::epsilon()) / rows;
RealScalar threshold_helper = m_colSqNorms.maxCoeff() * internal::abs2(NumTraits<Scalar>::epsilon()) / static_cast<double>(rows);
m_nonzero_pivots = size; // the generic case is that in which all pivots are nonzero (invertible case)
m_maxpivot = RealScalar(0);
@@ -413,7 +413,7 @@ ColPivHouseholderQR<MatrixType>& ColPivHouseholderQR<MatrixType>::compute(const
// Note that here, if we test instead for "biggest == 0", we get a failure every 1000 (or so)
// repetitions of the unit test, with the result of solve() filled with large values of the order
// of 1/(size*epsilon).
if(biggest_col_sq_norm < threshold_helper * (rows-k))
if(biggest_col_sq_norm < threshold_helper * static_cast<double>(rows-k))
{
m_nonzero_pivots = k;
m_hCoeffs.tail(size-k).setZero();