mikael-s-persson/ReaK — Issue #9: Return locations of K-neighbors
Author: daviddoria
Created: 2012-02-04 23:19:36+00:00
State: open

If you use this function:

inline void min_dist_linear_search(ForwardIterator first,
ForwardIterator last,
OutputContainer& output,
GetDistanceFunction distance,
CompareFunction compare,
unsigned int max_neighbors = 1,
DistanceValue radius = std::numeric_limits::infinity())

you get back the actual values of the points that are the neighbors. Often it seems like you would rather know the location of those points in the input container. Maybe an additional parameter NeighborIndexOutputContainer or something like that? Although I guess that only makes sense if the container is random access...

In my application, since I can't use the actual "search on the graph" type functions (because many of the nodes do not have valid descriptors), I have to keep a container of descriptors to perform the search on, but when I find the nearest descriptor, how do I know which node it was associated with?