[Numpy-discussion] convolve optimisation...

Stéfan van der Walt stefan at sun.ac.za
Wed Jun 24 08:40:37 EDT 2009


2009/6/24 fred <fredmfp at gmail.com>:
> fred a écrit :
>> Hi all,
>>
>> Say I have a 2D array A(nx, ny).
>>
>> In each A[i, j] I want to compute convolve(a, kernel)
>>
>> where a is subarray of A.
>>
>> a and kernel are small besides A.
> I forgot to mention: kernel is not constant, of course.
> It varies vs. others parameters.

If your kernel varies with i and j, you have little choice but to do
this at the C level.

Have a look at the Cython convolution example here:

http://docs.cython.org/docs/numpy_tutorial.html

Alternatively, David Cournapeau can take this opportunity to
illustrate his very nifty Neighbour Iterator.

Regards
Stéfan



More information about the NumPy-Discussion mailing list