On Mon, May 19, 2008 at 12:53 PM, Robin <[EMAIL PROTECTED]> wrote: > Hi, > > I think my understanding is somehow incomplete... It's not clear to me > why (simplified case) > > a[curidx,:] = scalar * a[2-curidx,:] > should be faster than > a = scalar * b > > In both cases I thought the scalar multiplication results in a new > array (new memory allocated) and then the difference between copying > that result into the existing array u[curix,:] or reassining the > reference u to that result should be very similar? > > If anything I would have thought the direct assignment would be > quicker since then there is no copying. > > What am I missing?
Actually, I think you are correct. My bad. I was mainly thinking in terms of weave.blitz, where it would make a difference, then translating back... --Hoyt +++++++++++++++++++++++++++++++++++ Hoyt Koepke UBC Department of Computer Science http://www.cs.ubc.ca/~hoytak/ [EMAIL PROTECTED] +++++++++++++++++++++++++++++++++++ _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion