reduce float warnings (comparisons and implicit conversions)

This commit is contained in:
Erik Schultheis
2022-01-26 18:16:19 +00:00
committed by Rasmus Munk Larsen
parent 51311ec651
commit d271a7d545
41 changed files with 152 additions and 133 deletions

View File

@@ -440,7 +440,7 @@ template<> struct ldlt_inplace<Lower>
// Update the terms of L
Index rs = size-j-1;
w.tail(rs) -= wj * mat.col(j).tail(rs);
if(gamma != 0)
if(!numext::is_exactly_zero(gamma))
mat.col(j).tail(rs) += (sigma*numext::conj(wj)/gamma)*w.tail(rs);
}
return true;

View File

@@ -297,7 +297,7 @@ static Index llt_rank_update_lower(MatrixType& mat, const VectorType& vec, const
if(rs)
{
temp.tail(rs) -= (wj/Ljj) * mat.col(j).tail(rs);
if(gamma != 0)
if(!numext::is_exactly_zero(gamma))
mat.col(j).tail(rs) = (nLjj/Ljj) * mat.col(j).tail(rs) + (nLjj * sigma*numext::conj(wj)/gamma)*temp.tail(rs);
}
}