Hi,

I am playing with multiple ways to speed up the following expression
(it is in the inner loop):


C[1:(M - 1)]=(a * C[2:] + b * C[1:(M-1)] + c * C[:(M-2)])

where C is an array of about 200-300 elements, M=len(C), a, b, c are scalars.

I played with numexpr, but it was way slower than directly using
numpy. It would be nice if I could create a Mx3 matrix without copying
memory and so I can use dot() to calculate the whole thing.

Can anyone help with giving some advices to make this faster?

Thanks,
G
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to