mikael-s-persson / ReaK

Software platform and algorithms for multi-body dynamics simulation, control, estimation, and path-planning. Intended for robotics software development and testing.
GNU General Public License v3.0
40 stars 11 forks source link

KNN search should be templated on the output container type #8

Closed daviddoria closed 12 years ago

daviddoria commented 12 years ago

Current the find_nearest_impl function stores the result of the search (the k nearest neighbors) in a std::multimap<distance_type, Key> . It would be nice to be able to instead store them in a vector, for example.

daviddoria commented 12 years ago

The min_dist_linear_search linear search indeed is templated like this, but the DVP tree does not seem to be.

mikael-s-persson commented 12 years ago

Switched to interface to take an output-iterator instead, similar to STL algorithms like std::copy. This strategy seems a lot better after all.