Skip to content

Commit

Permalink
Merge pull request #219 from kya8/master
Browse files Browse the repository at this point in the history
Improve RKNN search efficiency
  • Loading branch information
jlblancoc authored Nov 29, 2023
2 parents d09c4c7 + 1301aea commit 5f0ffa5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
nanoflann 1.5.2: UNRELEASED
* **Other changes**:
- Improve RKNN search efficiency ([PR#219](https://github.com/jlblancoc/nanoflann/pull/219) by [kya8](https://github.com/kya8)).

nanoflann 1.5.1: Released Nov 27, 2023
* **API changes:**
- Add new search method `rknnSearch()` for knn searches with a maximum radius.
Expand Down
4 changes: 1 addition & 3 deletions include/nanoflann.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class RKNNResultSet
dists = dists_;
count = 0;
if (capacity)
dists[capacity - 1] = (std::numeric_limits<DistanceType>::max)();
dists[capacity - 1] = maximumSearchDistanceSquared;
}

CountType size() const { return count; }
Expand All @@ -287,8 +287,6 @@ class RKNNResultSet
*/
bool addPoint(DistanceType dist, IndexType index)
{
if (dist > maximumSearchDistanceSquared) return true;

CountType i;
for (i = count; i > 0; --i)
{
Expand Down

0 comments on commit 5f0ffa5

Please sign in to comment.