mirror of https://github.com/CGAL/cgal
Fix test of AABB_tree (use of an epsilon)
The test 'aabb_naive_vs_tree_distance_triangle_test' failed something. It was due to a test using an epsilon, with a too-low epsilon value (1e-8). I managed to reproduce the bug, and the quantity compared to the epsilon value was about 1.8e-8. I increase the epsilon value to 1e-7, and add a few lines that show the compared values, when the test fails. Trivial bug-fix.
This commit is contained in:
parent
91090ec2b7
commit
3e93d0bfc6
|
|
@ -792,7 +792,13 @@ private:
|
|||
FT dist_naive = CGAL::squared_distance(query, point_naive);
|
||||
FT dist_tree = CGAL::squared_distance(query, point_tree);
|
||||
|
||||
const FT epsilon = FT(1e-8);
|
||||
const FT epsilon = FT(1e-7);
|
||||
if (CGAL::abs(dist_naive - dist_tree) > epsilon) {
|
||||
std::cerr.precision(17);
|
||||
std::cerr << "dist_tree: " << dist_tree
|
||||
<< "\ndist_naive: " << dist_naive
|
||||
<< "\ndifference: " << (dist_naive - dist_tree) << std::endl;
|
||||
}
|
||||
assert( (dist_naive - dist_tree) <= epsilon );
|
||||
assert( (dist_naive - dist_tree) >= (-1. * epsilon) );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue