Skip to content

Commit

Permalink
Add missing method KNNResultSet::empty() for consistency with the oth…
Browse files Browse the repository at this point in the history
…er result sets
  • Loading branch information
jlblancoc committed Nov 27, 2023
1 parent c6eca96 commit 5db886b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
nanoflann 1.5.1: UNRELEASED
* **API changes:**
- Add missing `SearchParameters` argument to `KDTreeSingleIndexDynamicAdaptor_::knnSearch()` ([PR#213](https://github.com/jlblancoc/nanoflann/pull/213) by [ManosPapadakis95](https://github.com/ManosPapadakis95)).
- Add missing method `KNNResultSet::empty()` for consistency with the other result sets.
* **Other changes**:
- Add examples: `nanoflann_gui_example_R3_knn` and `nanoflann_gui_example_R3_radius`


nanoflann 1.5.0: Released Jun 16, 2023
* **API changes:**
Expand Down
4 changes: 3 additions & 1 deletion include/nanoflann.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class KNNResultSet
}

CountType size() const { return count; }
bool empty() const { return count == 0; }

bool full() const { return count == capacity; }

Expand Down Expand Up @@ -2060,7 +2061,8 @@ class KDTreeSingleIndexDynamicAdaptor_
*/
Size knnSearch(
const ElementType* query_point, const Size num_closest,
IndexType* out_indices, DistanceType* out_distances, const SearchParameters& searchParams = {}) const
IndexType* out_indices, DistanceType* out_distances,
const SearchParameters& searchParams = {}) const
{
nanoflann::KNNResultSet<DistanceType, IndexType> resultSet(num_closest);
resultSet.init(out_indices, out_distances);
Expand Down

0 comments on commit 5db886b

Please sign in to comment.