diff options
author | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2020-11-03 11:56:52 +0100 |
---|---|---|
committer | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2020-11-03 11:56:52 +0100 |
commit | baaf350869dbd5ff78e22cc4c3de9b8ab35b75ba (patch) | |
tree | 2e03f45cd5cf0c637e8b136abd7a704c19ccd8eb | |
parent | 69c70afd0442774582b7e930bdab603600a3e750 (diff) |
code review: use relative error
-rw-r--r-- | src/Alpha_complex/test/Weighted_alpha_complex_unit_test.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Alpha_complex/test/Weighted_alpha_complex_unit_test.cpp b/src/Alpha_complex/test/Weighted_alpha_complex_unit_test.cpp index 2cd66963..3df76dbf 100644 --- a/src/Alpha_complex/test/Weighted_alpha_complex_unit_test.cpp +++ b/src/Alpha_complex/test/Weighted_alpha_complex_unit_test.cpp @@ -179,8 +179,8 @@ BOOST_AUTO_TEST_CASE(Weighted_alpha_complex_3d_comparison) { std::clog << std::endl; BOOST_CHECK(false); } - // I had to make a hard limit as it is converted from Kernel::FT - if (std::fabs(d3_itr->second - dD_itr->second) > 1e-5) { + // In safe mode, relative error is less than 1e-5 (can be changed with set_relative_precision_of_to_double) + if (std::fabs(d3_itr->second - dD_itr->second) / std::fabs(d3_itr->second) > 1e-5) { std::clog << d3_itr->second << " versus " << dD_itr->second << " diff " << std::fabs(d3_itr->second - dD_itr->second) << std::endl; BOOST_CHECK(false); } |