[SciPy-dev] Ball Tree class

David Cournapeau david at ar.media.kyoto-u.ac.jp
Fri Oct 30 01:58:40 EDT 2009


Jake VanderPlas wrote:
> Hello,
> I've been using scipy.spatial.KDTree for my research, and found it
> very useful.  Recently, though, my datasets have been getting larger -
> upwards of 10,000 points in 1000-2000 dimensions.
> The KDTree starts getting slow with such a
> large dimensionality.  I've addressed this by writing a C++ Ball Tree
> code, and wrapping it using swig and numpy.i.  I've been wanting to
> begin contributing to the scipy project, and I think this would be a
> great place to start.  I'd like to begin the process of adding
> this to the scipy.spatial package.
>
> A few questions: Is it preferable to have an
> implementation in C rather than C++?  Cython, swig, or hand-wrapped code?

Cython is nice to wrap code, but if your code is C++, you may have to
create a C API around it. I know Cython developers want to improve
support for C++, but I don't know the status of it.

If you use C++, stick to the standardized STL: no boost whatsoever, no
hash_map, etc... Avoid exception as much as possible as well.

cheers,

David



More information about the SciPy-Dev mailing list