Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer numbers::is_nan over std::isnan #15322

Merged
merged 1 commit into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/deal.II/lac/full_matrix.templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) << ' ';
Expand Down
2 changes: 1 addition & 1 deletion source/distributed/tria_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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];
};

Expand Down
2 changes: 1 addition & 1 deletion source/lac/lapack_full_matrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 << ' ';
Expand Down
2 changes: 1 addition & 1 deletion source/lac/solver_control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down