summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
diff options
context:
space:
mode:
authorglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-11-30 15:36:30 +0000
committerglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-11-30 15:36:30 +0000
commita666140907ef3dc72babd4e0968534c7b9265ce0 (patch)
tree61daf081e5b31f9464ad5448dd88689d21a20ae2 /src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
parentc9971ba210be041dfee85e986aafef9d9bdcd36f (diff)
Small optimization for neighbor search in bottleneck.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/misc-glisse@2989 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 5f13ee7292f8c43a430ee80d27e549ad0d1e938b
Diffstat (limited to 'src/Bottleneck_distance/include/gudhi/Neighbors_finder.h')
-rw-r--r--src/Bottleneck_distance/include/gudhi/Neighbors_finder.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h b/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
index a6b9b021..dc804630 100644
--- a/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
+++ b/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
@@ -44,7 +44,7 @@ struct Square_query {
typedef Internal_point Point_d;
typedef double FT;
bool contains(Point_d p) const {
- return std::abs(p.x()-c.x()) <= size && std::abs(p.y()-c.y()) <= size;
+ return std::max(std::abs(p.x()-c.x()), std::abs(p.y()-c.y())) <= size;
}
bool inner_range_intersects(CGAL::Kd_tree_rectangle<FT, D> const&r) const {
return