[Numpy-discussion] finding close together points.

Charles R Harris charlesr.harris at gmail.com
Wed Nov 11 10:14:57 EST 2009


On Tue, Nov 10, 2009 at 11:15 PM, David Cournapeau <
david at ar.media.kyoto-u.ac.jp> wrote:

> Charles R Harris wrote:
> >
> > I think Python lists are basically just expanding arrays and pointers
> > are cheap. Where you might lose is in creating python objects to put
> > in the list and not having ufuncs and the rest of the numpy machinery.
> > If you don't need the machinery, lists are probably not a bad way to go.
>
> I am not familiar enough with the kdtree code: if you need to manipulate
> core datatypes (float, etc...), I think python lists are a significant
> cost, because of pointer chasing in particular. It may or may not apply,
> but Stefan used some tricks to avoid using python list and use basic C
> structures in some custom code (written in cython), maybe he has
> something to say.
>
> I would love having a core C library of containers - there are a few
> candidates we could take code from:
>

I've got a cythonized structure for union-find (relations) and we could put
together a heap pretty easily from heap sort. I've also got one for the
problem at hand, but it is for several thousand points (stars) scattered
over an image and uses c++ lists.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20091111/87bf7040/attachment.html>


More information about the NumPy-Discussion mailing list