Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve RKNN search efficiency #219

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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