]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Prefer numbers::is_nan over std::isnan 15322/head
authorMarc Fehling <mafehling.git@gmail.com>
Tue, 6 Jun 2023 21:20:35 +0000 (15:20 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Tue, 6 Jun 2023 21:20:35 +0000 (15:20 -0600)
include/deal.II/lac/full_matrix.templates.h
source/distributed/tria_base.cc
source/lac/lapack_full_matrix.cc
source/lac/solver_control.cc

index c60726c6fb846b66fe5075cf6481da646c600a08..273e70425d578a6c64009421ff07383d5d17966d 100644 (file)
@@ -1726,7 +1726,7 @@ FullMatrix<number>::print_formatted(std::ostream &     out,
       for (size_type j = 0; j < n(); ++j)
         // we might have complex numbers, so use abs also to check for nan
         // since there is no isnan on complex numbers
-        if (std::isnan(std::abs((*this)(i, j))))
+        if (numbers::is_nan(std::abs((*this)(i, j))))
           out << std::setw(width) << (*this)(i, j) << ' ';
         else if (std::abs((*this)(i, j)) > threshold)
           out << std::setw(width) << (*this)(i, j) * number(denominator) << ' ';
index 698892adee89b1c4b2a6a5a0a986c6dccc1e329b..8970a90d3e9c2c7057c79fa7b35bf5323fb19bf0 100644 (file)
@@ -613,7 +613,7 @@ namespace parallel
 
     const auto unpack = [&](const auto &cell, const auto &vertices) {
       for (const auto v : cell->vertex_indices())
-        if (std::isnan(vertices[v][0]) == false)
+        if (numbers::is_nan(vertices[v][0]) == false)
           cell->vertex(v) = vertices[v];
     };
 
index 1d61dea4cbc0542efd19bca6298736767c947d06..24aa99b8319d80d29acb18b01e5ea25da47279b8 100644 (file)
@@ -2461,7 +2461,7 @@ LAPACKFullMatrix<number>::print_formatted(std::ostream &     out,
       for (size_type j = 0; j < nc; ++j)
         // we might have complex numbers, so use abs also to check for nan
         // since there is no isnan on complex numbers
-        if (std::isnan(std::abs((*this)(i, j))))
+        if (numbers::is_nan(std::abs((*this)(i, j))))
           out << std::setw(width) << (*this)(i, j) << ' ';
         else if (std::abs(this->el(i, j)) > threshold)
           out << std::setw(width) << this->el(i, j) * denominator << ' ';
index f5a0d9eb40b19b7e992f0beee49994f09b0a1d9d..f98fac4e30425a85d74ba999abda601ed669eb80 100644 (file)
@@ -89,7 +89,7 @@ SolverControl::check(const unsigned int step, const double check_value)
       return success;
     }
 
-  if ((step >= maxsteps) || std::isnan(check_value) ||
+  if ((step >= maxsteps) || numbers::is_nan(check_value) ||
       (check_failure && (check_value > failure_residual)))
     {
       if (m_log_result)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.