[pypy-dev] Newcommer in pypy, numpy user

Simon Burton simon at arrowtheory.com
Wed Dec 20 17:08:24 CET 2006

On Wed, 20 Dec 2006 11:50:37 +0900
David Cournapeau <david at ar.media.kyoto-u.ac.jp> wrote:

> So for example, if a and b are numpy arrays, a python expression b *= a 
> would be translated in C by something like for(i = 0; i < b.size; ++i) 
> {b[i] *= a[i];} ?

Yes, but numpy already does this. The ultimate goal was to be able to
collapse many such operations into an "optimal" (minimal) number of loops, eg.

a = b + c + d => for(...) {a[i]=b[i]+c[i]+d[i]}

which is much more cache friendly.


More information about the Pypy-dev mailing list