On 13.02.2013 15:41, Sturla Molden wrote:
http://www.cs.umd.edu/~mount/Papers/cgc99-smpack.pdf
If you take a look at their Figure 3, you can see what's happening.
If you use qsort and split on the median, you get a kd-tree similar to the one on the left ('Standard split').
If you use the algorithm in cKDTree.__build, you get a kd-tree similar to the one on the right ('Sliding-midpoint split').
You get much faster spatial queries from the kd-tree to the right. That is why we didn't use sorting/medians to build up the kd-trees in SciPy.
Sturla
--
--- You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
On 13.02.2013 19:52, Jake Vanderplas wrote:No, that would require a rotation of the data. Finding the smallest possible box is an NP complete problem.
In cKDTree, from what I understand, the effective
bounding box of each node is shrunk to be the smallest possible box
which contains all its data.
It just pics a box that contains all the data, and makes it as small as possible. But it is not "the smallest bounding box"!
Because the data is N-dimensional, there can still be a lot of empty space in the box. A single outlier in one dimension can generate a lot of empty space.
If I have this array :
cdef int array[100]
And want to do a 50 to 100 slice:
cdef int slice[]
slice = array + 50
But to get 1 to 50 slice :
slice = array - 50 ?
and how to for 25 to 75 slice ?
I like to see I starting a good discussion about kdtree soo I let's you continue after this question :)
--
---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
By the way: GCC intrinsics are never "portable", never assume that.
I meant "portable" as in works in GCC most of the time, but apparently not
in MinGW on Windows. If you say that that works, too, I wonder what the
original problem was, because the symptom was clearly as described in the
GCC docs I quoted above.
"Not all operations are supported by all target processors. If a particular operation cannot be implemented on the target processor, a warning will be generated and a call an external function will be generated. The external function will carry the same name as the builtin, with an additional suffix `_n' where n is the size of the data type."
I read target PROCESSORs, not target OS...
I suppose it has do with what opcode GCC can generate. But on any x86 or amd64 processor (the only target platforms supported by MinGW), GCC can surely generate opcode for atomic memory access. That is no different form e.g. compiling for the same processors on Linux.
Sturla
Okay , that's weird because I have the same problem on two computer:
-ThinkStation S20 with i7 processor , 24gig of ram , Windows7 64bit professional , fresh install of python 3.3 last week, fresh install of Cython 1.8 (last week), fresh install of MinGW 4.7.2 with the get-installer and I click on "download last catalogue"
-Acer AspireOne , 1gig of ram , Windows XP 32bit Home edition , fresh install of python 3.3 this weekend, fresh install of Cython 1.8 (this weekend), fresh install of MinGW 4.7.2 with the get-installer and I click on "download last catalogue"
All install of my MinGW are done with the get-installer so it's downloaded from the server.
I suppose if I try it on my AspireOne notebook , I replace i686 for i486 ? I'm in the bus to back home now , not near of my i7.
ok. What this doing exactly ? Optimized code?
Oh and I forget , "..._flags" don't work , it's probably just a mistake. "..._args" working. For any body else reading the post.