Template Function nanoflann::detail::addPointToSortedResultSet

Function Documentation

template<typename DistanceType, typename IndexType, typename CountType>
bool nanoflann::detail::addPointToSortedResultSet(DistanceType *dists, IndexType *indices, CountType &count, CountType capacity, DistanceType dist, IndexType index)

Insert (dist, index) into a sorted result buffer (dists, indices) of the given capacity, keeping ascending distance order. Shared by KNNResultSet and RKNNResultSet, which are otherwise byte-for-byte identical. Always returns true (caller should continue searching).