[SciPy-user] 2D arrays in weave.inline

Gael Varoquaux gael.varoquaux@normalesup....
Sat Nov 17 17:36:06 CST 2007


On Sat, Nov 17, 2007 at 05:30:18PM -0600, Alan Jackson wrote:
> I'm not sure where the blitz errors came from - the same code compiled
> clean with inline, so that is a mystery (I did modify the arrays for
> blitz before compiling).

Just checking: you did replace the "M[x, y]" by "M(x, y)" in all your
code? 

> I also created all the arrays I wanted returned in numpy first - which
> makes for a really long function call, but it works and it is not too
> awkward.

I always do that. It removes all memory management from the C level.
Tht's one less hurdle. I usual wrap my function in a another one, to hide
this ugly function call, though.

> I got a speed up of x37 on my real test. 

Nice !

Gaël


More information about the SciPy-user mailing list