Finding all points within distance r of a given point

Sylvain Bougerel sylvain.bougerel.devel at gmail.com
Sat Dec 13 01:29:56 UTC 2008


Hi Olumide,

I quite understand why:

 //tree_type assigned;
 //assigned = src;
 tree_type assigned(src);

this makes it work. But not commenting out of the print function.
Anyway, if the version you've downloaded comes from the main git tree,
regretably, it has a bug. However, we have fixed it, and soon we will
release a new version (a matter of a few days).

Sorry for the inconvenieance.


On Fri, Dec 12, 2008 at 9:56 AM, Olumide <50295 at web.de> wrote:
> I just had a colleague who's good at STL look at the error, and he made
> the following change to the example kdtree.hpp:
>
>   //tree_type assigned;
>   //assigned = src;
>   tree_type assigned(src);
>
> and commented out lines 1214 - 1238 of kdtree.hpp i.e.
>
>       o << "meta node:   " << tree._M_header << std::endl;
>       o << "root node:   " << tree._M_root << std::endl;
>
>       if (tree.empty())
>         return o << "[empty " << __K << "d-tree " << &tree << "]";
>
>       o << "nodes total: " << tree.size() << std::endl;
>       o << "dimensions:  " << __K << std::endl;
>
>       typedef KDTree<__K, _Val, _Acc, _Dist, _Cmp, _Alloc> _Tree;
>       typedef typename _Tree::_Link_type _Link_type;
>
>       std::stack<_Link_const_type> s;
>       s.push(tree._M_get_root());
>
>       while (!s.empty())
>         {
>           _Link_const_type n = s.top();
>           s.pop();
>           o << *n << std::endl;
>           if (_Tree::_S_left(n)) s.push(_Tree::_S_left(n));
>           if (_Tree::_S_right(n)) s.push(_Tree::_S_right(n));
>         }
>
> Now the example compiles.
>
>
>
>
>
> _______________________________________________
> 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