[Numpy-discussion] Cython numerical syntax revisited

Francesc Alted faltet at pytables.org
Thu Mar 5 07:35:33 EST 2009


A Thursday 05 March 2009, Dag Sverre Seljebotn escrigué:
> No, one could do the same thing that NumPy does (I think, never
> looked into it in detail), i.e:
>
> decide on dimension to do innermost dynamically from strides and
> sizes save the stride in that dimension for each array
> for loop using n-dimensional iterator with larger per-loop overhead:
>    save offsets
>    for loop on the innermost dimension with lower per-loop overhead:
>        component-wise operation using offsets and innermost strides

I see.  Yes, it seems definitely doable.  However, I don't understand 
very well when you say that you have to "decide on dimension to do 
innermost dynamically".  For me, this dimension should always be the 
trailing dimension, in order to maximize the locality of data.  Or I'm 
missing something?

-- 
Francesc Alted



More information about the NumPy-Discussion mailing list