Skip to content

Commit

Permalink
Add some comments after talking to AF.
Browse files Browse the repository at this point in the history
  • Loading branch information
André Nusser committed Dec 16, 2024
1 parent 79ecd1b commit 0311b1c
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ class FrechetKdTree
// AF: In case Point stays the input point type we have
// to robustify with interval arithmetic
// here: certainly
// AN: yes, here we need certainly!
if (compare_squared_distance(a, b, distance_sqr) == LARGER) {
return false;
}
}
for (size_t i = 4; i < 8; ++i) {
// AF: certainly
// AN: yes, here we need certainly!
if (CGAL::abs(p[i] - q[i]) > distance) {
return false;
}
Expand All @@ -118,12 +120,16 @@ class FrechetKdTree
for (int d = 0; d < D::value; ++d) {
if (rect.min_coord(d) > p[d] + distance &&
rect.max_coord(d) + distance < p[d]) {
// AF: certainly
// AF: certainly
// AN: yes, here is really certainly!
return false;
}
}
return true;
}

// AN: here we cannot really do anything wrong; if we return false, we continue searching;
// if we return true, we return all points inside which is also fine as we check them later.
bool outer_range_contains(const Kd_tree_rectangle<FT, D>& rect) const
{
// check if rect[0:2] is contained in circle of start point AND
Expand All @@ -138,7 +144,6 @@ class FrechetKdTree
{rect.min_coord(i + 1), rect.max_coord(i + 1)}) {
if (compare_squared_distance(Point(x, y), point,
distance_sqr) == LARGER) {
// AF: certainly
return false;
}
}
Expand All @@ -151,11 +156,11 @@ class FrechetKdTree
for (std::size_t i = 4; i < 8; ++i) {
if (p[i] - distance > rect.min_coord(i) ||
p[i] + distance < rect.max_coord(i)) {
// AF: certainly
return false;
}
}

// AN: This has to be certainly!!
return true;
}
};
Expand Down

0 comments on commit 0311b1c

Please sign in to comment.