Visit_within_range predicate

Andrew Leung anwleung at gmail.com
Mon Aug 24 00:41:43 UTC 2009


Hi,

Thanks for the quick response.

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.

Andrew

On Aug 22, 2009, at 7:55 PM, Paul Harris wrote:

> the find_ and visit_ methods either will find the 'nearest', or find  
> 'all' in the range...
> 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.
>
> eg
>
> struct found_one
> {
>    YourInfo info;
> };
>
> class Visitor
> {
>    etc operator() etc
>   {
>     found_one result;  result.info = whatever;  throw result;
>   }
> }
>
> then a try, catch block will catch the results.
>
> Sorry thats a bit messy, but thats one approach.
>
> Paul
>
>
> 2009/8/23 Andrew Leung <anwleung at gmail.com>
> Hi,
>
> I am using libkdtree++ and would like to get a couple of tips on how  
> I can improve my performance.
>
> 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?
>
> Thanks.
> Andrew
>
> _______________________________________________
> libkdtree-devel mailing list
> libkdtree-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/libkdtree-devel
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libkdtree-devel/attachments/20090823/5a8c9331/attachment.htm>


More information about the libkdtree-devel mailing list