find_kth_nearest
Sylvain Bougerel
sylvain.bougerel.devel at gmail.com
Sun Oct 21 05:10:51 UTC 2007
On 10/20/07, Paul Harris <paulharris at computer.org> wrote:
> So instead, you could have a function find_nearest_somename(), which
> accepts a functor which has a signature like...
>
> void push(value_type const& x);
> bool compare_lt(dimension x) const;
> and some function to extract the result, eg
> void iterate_results(Iterator it) const;
>
> so to make find_nearest_pth(), the functor would keep a list of the
> last P nodes, and compare against the Pth one.
> At the same time, a functor could be made to implement find_nearest()
> and find_within_range(). So with kdtree could come at least 3
> ready-made functors, and the handy find_nearest() etc functions would
> simply call find_generic(appropriate_functor());
>
> know what I mean?
Hi Paul,
Like said before, I very much like having a functor/predicate to
control the behavior of find. But it might be difficult to find how to
do it: the more complicated the function, the more difficult it is for
people to use it.
I don't see a simple solution right now. At the moment, adding a nth
_M_find_... could be easier: it would not break the design of the
existing _M_find_...
Is this urgently needed (less than a month?)
- Sylvain
More information about the libkdtree-devel
mailing list