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

@@ -519,7 +519,7 @@ void FullPivLU<MatrixType>::computeInPlace()
row_of_biggest_in_corner += k; // correct the values! since they were computed in the corner,
col_of_biggest_in_corner += k; // need to add k to them.
if(biggest_in_corner==Score(0))
if(numext::is_exactly_zero(biggest_in_corner))
{
// before exiting, make sure to initialize the still uninitialized transpositions
// in a sane state without destroying what we already have.

View File

@@ -378,7 +378,7 @@ struct partial_lu_impl
row_transpositions[k] = PivIndex(row_of_biggest_in_col);
if(biggest_in_corner != Score(0))
if(!numext::is_exactly_zero(biggest_in_corner))
{
if(k != row_of_biggest_in_col)
{
@@ -404,7 +404,7 @@ struct partial_lu_impl
{
Index k = endk;
row_transpositions[k] = PivIndex(k);
if (Scoring()(lu(k, k)) == Score(0) && first_zero_pivot == -1)
if (numext::is_exactly_zero(Scoring()(lu(k, k))) && first_zero_pivot == -1)
first_zero_pivot = k;
}