Skip to content

Commit

Permalink
Merge pull request #121 from azaleostu/knngraph-assert-fix
Browse files Browse the repository at this point in the history
[SpatialPartitioning] Fix assertions in KNN graph range query
  • Loading branch information
nmellado authored Dec 8, 2023
2 parents 0f467fd + d1d9c52 commit 9b42731
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Current head (v.1.2 RC)
- [fitting] Use variadic template for basket extensions (#85)
- [fitting] Fix current status issue (#108)
- [spatialPartitioning] Fix potential compilation issues in KnnGraph (#111)
- [spatialPartitioning] Fix debug macros in KnnGraphRangeQuery (#121)
- [fitting] Fix sphere fit eigen solver (#112)

-Docs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ class KnnGraphRangeQuery : public RangeIndexQuery<typename Traits::IndexType, ty
int idx_current = m_stack.top();
m_stack.pop();

PONCA_DEBUG_ASSERT((point - points[idx_current]).squaredNorm() < m_squared_radius);
PONCA_DEBUG_ASSERT((point - points[idx_current].pos()).squaredNorm() < QueryType::squared_radius());

iterator.m_index = idx_current;

for(int idx_nei : m_graph->k_nearest_neighbors(idx_current))
{
PONCA_DEBUG_ASSERT(idx_nei>0);
PONCA_DEBUG_ASSERT(idx_nei>=0);
Scalar d = (point - points[idx_nei].pos()).squaredNorm();
Scalar th = QueryType::descentDistanceThreshold();
if((point - points[idx_nei].pos()).squaredNorm() < QueryType::descentDistanceThreshold() && m_flag.insert(idx_nei).second)
Expand Down

0 comments on commit 9b42731

Please sign in to comment.