Let a and b be two numpy.float arrays of length 1024, defined with
cdef numpy.ndarray a
cdef numpy.ndarray b
I notice that:
cdef int i
for i in range(1024):
b[i] += a[i]
is considerably slower than:
b += a
Why?
I really need to be able to loop manually over arrays.
cdef float xa 32-bit or 64-bit float? Which cdef type will work with numpy.float32, numpy.float64? I looked at the doc but didn't find precise correspondance.float <=> numpy.float32,double <=> numpy.float64 = numpy.floatnditerhandles loops like this nicely.