[Numpy-discussion] fast way to convolve a 2d array with 1d filter
Charles R Harris
Tue Dec 2 01:05:04 CST 2008
On Mon, Dec 1, 2008 at 11:14 PM, frank wang <firstname.lastname@example.org> wrote:
> This is what I thought to do. However, I am not sure whether this is a
> fast way to do it and also I want to find a more generous way to do it. I
> thought there may be a more elegant way to do it.
Well, for just the one matrix not much will speed it up. If you have lots of
matrices and the coefficients are fixed, then you can set up a "convolution"
matrix whose columns are the coefficients shifted appropriately. Then just
do a matrix multiply.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion