<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi,</div><div><br></div><div>Thanks for the quick response.</div><div><br></div><div>Another quick question. Most of the range queries I perform use the same 3 dimensions. Each node has 12 total dimensions. For performance, does it matter where in the dimension order these 3 dimensions should be? If they are the first 3 dimension checked it seems like performance would be improved, especially since I stop searching after the first match. Thanks.</div><div><br></div><div>Andrew</div><br><div><div>On Aug 22, 2009, at 7:55 PM, Paul Harris wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">the find_ and visit_ methods either will find the 'nearest', or find 'all' in the range...<br>So without writing a new method called something like visit_first_within_range(), you could just throw an exception inside the visitor when you have a satisfactory result.<br> <br>eg<br><br>struct found_one<br>{<br> YourInfo info;<br>};<br><br>class Visitor<br>{<br> etc operator() etc<br> {<br> found_one result; <a href="http://result.info">result.info</a> = whatever; throw result;<br> }<br>}<br><br>then a try, catch block will catch the results.<br><br>Sorry thats a bit messy, but thats one approach.<br><br>Paul<br><br><br><div class="gmail_quote">2009/8/23 Andrew Leung <span dir="ltr"><<a href="mailto:anwleung@gmail.com">anwleung@gmail.com</a>></span><br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br> <br> I am using libkdtree++ and would like to get a couple of tips on how I can improve my performance.<br> <br> In most instances when I query the KD-tree using the visit_within_range() function, I do not need to continue the search once any tree node is found that is within the range. Is there a way to stop the query once a node is found to satisfy the query? The REGION.encloses() call tends to be very expensive and I would like to avoid any needless calls to this function. Is it possible to just 'return visitor;' when the REGION.encloses() condition is meet?<br> <br> Thanks.<br> Andrew<br> <br> _______________________________________________<br> libkdtree-devel mailing list<br> <a href="mailto:libkdtree-devel@lists.alioth.debian.org" target="_blank">libkdtree-devel@lists.alioth.debian.org</a><br> <a href="http://lists.alioth.debian.org/mailman/listinfo/libkdtree-devel" target="_blank">http://lists.alioth.debian.org/mailman/listinfo/libkdtree-devel</a><br> </blockquote></div><br></blockquote></div><br></body></html>