jlblancoc / nanoflann

nanoflann: a C++11 header-only library for Nearest Neighbor (NN) search with KD-trees
Other
2.26k stars 491 forks source link

Ordered indices returned from radius searches? #238

Open AaronLK opened 8 months ago

AaronLK commented 8 months ago

Hello, I'd like to pre-sort the point data I have prior to building an index, and then have the results of radiusSearch return indices in the same order. Any idea how this might be possible/doable?

The reason is because I've currently got some n^2 operations happening and would like to fix that for speed (loop is 1. radius search 2. sort results by z 3. using median z).

If the indices were returned in the same order, then I could just drop the re-sorting.