Skip to content
Snippets Groups Projects
Commit ad6362c8 authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[T] Make Eigen test predicate work with NaNs

parent 13d20697
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,9 @@ struct EigenIsNear ...@@ -79,7 +79,9 @@ struct EigenIsNear
{ {
auto const diff_comp = diff(r, c); auto const diff_comp = diff(r, c);
if (std::abs(diff_comp) > abstol) if (!(std::abs(diff_comp) <= abstol)
// writing the comparison in this way also works with NaN
)
{ {
return testing::AssertionFailure() return testing::AssertionFailure()
<< a_expr << " and " << b_expr << " differ by |" << a_expr << " and " << b_expr << " differ by |"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment