Re: [Numpy-discussion] speeding up the following expression

2011-11-12 Thread Geoffrey Zhu
Hi Warren, On Sat, Nov 12, 2011 at 9:31 AM, Warren Weckesser wrote: > > > On Sat, Nov 12, 2011 at 6:43 AM, wrote: >> >> On Sat, Nov 12, 2011 at 3:36 AM, Geoffrey Zhu wrote: >> > Hi, >> > >> > I am playing with multiple ways to speed up the following expression >> > (it is in the inner loop): >>

Re: [Numpy-discussion] speeding up the following expression

2011-11-12 Thread Warren Weckesser
On Sat, Nov 12, 2011 at 11:16 AM, wrote: > On Sat, Nov 12, 2011 at 11:32 AM, Warren Weckesser > wrote: > > > > > > On Sat, Nov 12, 2011 at 9:59 AM, wrote: > >> > >> On Sat, Nov 12, 2011 at 10:31 AM, Warren Weckesser > >> wrote: > >> > > >> > > >> > On Sat, Nov 12, 2011 at 6:43 AM, wrote: > >>

Re: [Numpy-discussion] speeding up the following expression

2011-11-12 Thread josef . pktd
On Sat, Nov 12, 2011 at 11:32 AM, Warren Weckesser wrote: > > > On Sat, Nov 12, 2011 at 9:59 AM, wrote: >> >> On Sat, Nov 12, 2011 at 10:31 AM, Warren Weckesser >> wrote: >> > >> > >> > On Sat, Nov 12, 2011 at 6:43 AM, wrote: >> >> >> >> On Sat, Nov 12, 2011 at 3:36 AM, Geoffrey Zhu >> >> wrot

Re: [Numpy-discussion] speeding up the following expression

2011-11-12 Thread Warren Weckesser
On Sat, Nov 12, 2011 at 9:59 AM, wrote: > On Sat, Nov 12, 2011 at 10:31 AM, Warren Weckesser > wrote: > > > > > > On Sat, Nov 12, 2011 at 6:43 AM, wrote: > >> > >> On Sat, Nov 12, 2011 at 3:36 AM, Geoffrey Zhu > wrote: > >> > Hi, > >> > > >> > I am playing with multiple ways to speed up the fo

Re: [Numpy-discussion] speeding up the following expression

2011-11-12 Thread josef . pktd
On Sat, Nov 12, 2011 at 10:31 AM, Warren Weckesser wrote: > > > On Sat, Nov 12, 2011 at 6:43 AM, wrote: >> >> On Sat, Nov 12, 2011 at 3:36 AM, Geoffrey Zhu wrote: >> > Hi, >> > >> > I am playing with multiple ways to speed up the following expression >> > (it is in the inner loop): >> > >> > >>

Re: [Numpy-discussion] speeding up the following expression

2011-11-12 Thread Warren Weckesser
On Sat, Nov 12, 2011 at 6:43 AM, wrote: > On Sat, Nov 12, 2011 at 3:36 AM, Geoffrey Zhu wrote: > > 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

Re: [Numpy-discussion] speeding up the following expression

2011-11-12 Thread josef . pktd
On Sat, Nov 12, 2011 at 3:36 AM, Geoffrey Zhu wrote: > 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

[Numpy-discussion] speeding up the following expression

2011-11-12 Thread Geoffrey Zhu
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