From: Marc Fehling Date: Tue, 6 Jun 2023 21:20:35 +0000 (-0600) Subject: Prefer numbers::is_nan over std::isnan X-Git-Tag: v9.5.0-rc1~147^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3d406107735019350b6420bd4afef3310caae39;p=dealii.git Prefer numbers::is_nan over std::isnan --- diff --git a/include/deal.II/lac/full_matrix.templates.h b/include/deal.II/lac/full_matrix.templates.h index c60726c6fb..273e70425d 100644 --- a/include/deal.II/lac/full_matrix.templates.h +++ b/include/deal.II/lac/full_matrix.templates.h @@ -1726,7 +1726,7 @@ FullMatrix::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) << ' '; diff --git a/source/distributed/tria_base.cc b/source/distributed/tria_base.cc index 698892adee..8970a90d3e 100644 --- a/source/distributed/tria_base.cc +++ b/source/distributed/tria_base.cc @@ -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]; }; diff --git a/source/lac/lapack_full_matrix.cc b/source/lac/lapack_full_matrix.cc index 1d61dea4cb..24aa99b831 100644 --- a/source/lac/lapack_full_matrix.cc +++ b/source/lac/lapack_full_matrix.cc @@ -2461,7 +2461,7 @@ LAPACKFullMatrix::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 << ' '; diff --git a/source/lac/solver_control.cc b/source/lac/solver_control.cc index f5a0d9eb40..f98fac4e30 100644 --- a/source/lac/solver_control.cc +++ b/source/lac/solver_control.cc @@ -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)