Re: [Numpy-discussion] speed of numpy.ndarray compared to Numeric.array

2011-01-10 Thread René Dudfield
Hi, Spatial hashes are the common solution. Another common optimization is using the distance squared for collision detection. Since you do not need the expensive sqrt for this calc. cu. On Mon, Jan 10, 2011 at 3:25 PM, Pascal wrote: > Hi, > > On 01/10/2011 09:09 AM, EMMEL Thomas wrote: >>

Re: [Numpy-discussion] speed of numpy.ndarray compared to Numeric.array

2011-01-10 Thread Pascal
Hi, On 01/10/2011 09:09 AM, EMMEL Thomas wrote: > > No I didn't, due to the fact that these values are coordinates in 3D (x,y,z). > In fact I work with a list/array/tuple of arrays with 10 to 1M of > elements or more. > What I need to do is to calculate the distance of each of these elements

Re: [Numpy-discussion] speed of numpy.ndarray compared to Numeric.array

2011-01-10 Thread EMMEL Thomas
Hey back... > > > #~ > ~ > ~~~ > > def bruteForceSearch(points, point): > > > > minpt = min([(vec2Norm(pt, point), pt, i) > > for i, pt in enumerate(points)], key=itemgetter(0)) > > return sqrt(minpt[0]), m

Re: [Numpy-discussion] speed of numpy.ndarray compared to Numeric.array

2011-01-10 Thread Sebastian Berg
Hey, On Mon, 2011-01-10 at 08:09 +, EMMEL Thomas wrote: > #~ > def bruteForceSearch(points, point): > > minpt = min([(vec2Norm(pt, point), pt, i) > for i, pt in enumerate(points)], key=itemgetter(0))

Re: [Numpy-discussion] speed of numpy.ndarray compared to Numeric.array

2011-01-10 Thread David Cournapeau
On Mon, Jan 10, 2011 at 5:09 PM, EMMEL Thomas wrote: > To John: > >> Did you try larger arrays/tuples? I would guess that makes a significant >> difference. > > No I didn't, due to the fact that these values are coordinates in 3D (x,y,z). > In fact I work with a list/array/tuple of arrays with 100

Re: [Numpy-discussion] speed of numpy.ndarray compared to Numeric.array

2011-01-10 Thread EMMEL Thomas
To John: > Did you try larger arrays/tuples? I would guess that makes a significant > difference. No I didn't, due to the fact that these values are coordinates in 3D (x,y,z). In fact I work with a list/array/tuple of arrays with 10 to 1M of elements or more. What I need to do is to calculat

Re: [Numpy-discussion] speed of numpy.ndarray compared to Numeric.array

2011-01-07 Thread Benjamin Root
On Fri, Jan 7, 2011 at 9:58 AM, EMMEL Thomas wrote: > Hi, > > There are some discussions on the speed of numpy compared to Numeric in > this list, however I have a topic > I don't understand in detail, maybe someone can enlighten me... > I use python 2.6 on a SuSE installation and test this: > >

Re: [Numpy-discussion] speed of numpy.ndarray compared to Numeric.array

2011-01-07 Thread John Salvatier
Did you try larger arrays/tuples? I would guess that makes a significant difference. On Fri, Jan 7, 2011 at 7:58 AM, EMMEL Thomas wrote: > Hi, > > There are some discussions on the speed of numpy compared to Numeric in > this list, however I have a topic > I don't understand in detail, maybe so

[Numpy-discussion] speed of numpy.ndarray compared to Numeric.array

2011-01-07 Thread EMMEL Thomas
Hi, There are some discussions on the speed of numpy compared to Numeric in this list, however I have a topic I don't understand in detail, maybe someone can enlighten me... I use python 2.6 on a SuSE installation and test this: #Python 2.6 (r26:66714, Mar 30 2010, 00:29:28) #[GCC 4.3.2 [gcc-4_3