Single dimension search
Andrew Leung
anwleung at gmail.com
Fri Jan 18 21:32:54 UTC 2008
Thanks for the quick reply.
Now that I have changed the triplet '==' operator, how can I view all
matches from a find or find_nearest, which match the input triplet? The
only function that seems to have an output iterator for returned results
is find_within_range. If find or find_nearest have multiple points to
return, how can I retrieve these?
Thanks again for your help.
Andrew
martin f krafft wrote:
> also sprach Andrew Leung <anwleung at gmail.com> [2008.01.18.2005 +0100]:
>
>> For example, test_kdtree.cpp creates triplets and searches the tree
>> using other triplets as comparators. Is there a way I can search using 1
>> or 2 of the triplet fields, not all three? Such as, find all triplets
>> with a first dimension value of 5. Thanks for your help.
>>
>
> Kd-Trees are not made for this sort of search, but since you get to
> specify your own comparator, it's simple to do, I'd say:
>
> Modifying test_kdtree.cpp:
>
> inline bool operator==(triplet const& A, triplet const& B) {
> return A.d[0] == B.d[0];
> }
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> libkdtree-devel mailing list
> libkdtree-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/libkdtree-devel
>
More information about the libkdtree-devel
mailing list