Hi Ali,<br><br>You could probably do it right now via find_nearest_if() and a predicate...&nbsp; off the top of my head:<br><br>the predicate could be a struct with a state variable (ie pimpl pattern so it can be copied around, and keeps the data in a pointer)...&nbsp;&nbsp; it will be called with a node each time it gets closer and closer to the nearest node.<br>
<br>the predicate could do a distance comparison each time, and store the best two nodes that it sees.&nbsp;&nbsp; then it can return TRUE each time the node is CLOSER than the SECOND node (the second-closest point), and return FALSE each time the node is FURTHER than the second node.<br>
<br>i think that would work, you want a fast response so there is a possibly half-baked idea.<br><br>see ya<br>Paul<br><br><div><span class="gmail_quote">On 23/04/2008, <b class="gmail_sendername">Ali -</b> &lt;<a href="mailto:saveez@hotmail.com">saveez@hotmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br> Hi,<br> <br> It seems someone asked about this feature in October last year which, unfortunately, has not been implemented yet. It was suggested that adding a new _M_find() with some modifications could be a quick way of doing this, it is not clear to me how this may be done.<br>
 <br> Currently I am only interested in the 1st and 2nd nearest neighbours, I wonder if a developer could provide a working example for this. This is urgent, a less-than-12-hours remedy is well appreciated.<br> <br> Moreover, is there any examples around for the new find() framework?<br>
 <br> -Ali<br> <br> _________________________________________________________________<br> Be a superhero and win! Play the Iron Man Mashup Game<br> <a href="http://www.ironmanmashup.co.uk">http://www.ironmanmashup.co.uk</a><br>
 _______________________________________________<br> libkdtree-devel mailing list<br> <a href="mailto:libkdtree-devel@lists.alioth.debian.org">libkdtree-devel@lists.alioth.debian.org</a><br> <a href="http://lists.alioth.debian.org/mailman/listinfo/libkdtree-devel">http://lists.alioth.debian.org/mailman/listinfo/libkdtree-devel</a><br>
 </blockquote></div><br>