mikael-s-persson/ReaK — Issue #11: min_dist_linear_search Output container must be pre-initialized
Author: daviddoria
Created: 2012-02-24 18:58:22+00:00
State: open

I just dropped your new version of min_dist_linear_search for a KNN search (using the priority queue algorithm) into my code. It works great! I was trying to get 100k neighbors, and it was causing a huge slow down with the old method, but the new one is very very fast.

The only thing I didn't immediately notice is that the output container has to be pre-sized to fit the neighbors. (I was getting a crash on *result = *(Q.top().second); ). I notice now that the comment says:

* \tparam OutputIterator The bidirectional- output-iterator type which can contain the list of nearest-neighbors.

The "which can contain" I guess indicates that the size has to be right, but you may want to state this more explicitly.