[SciPy-User] Problem with passing a 2D Numpy array in the C code by weave.inline
Thu Dec 3 05:19:50 CST 2009
2009/12/3 Steven Nien <firstname.lastname@example.org>
> I'm trying to pass a 2 dimensional numpy array into the 'weave.inline' and
> doing some computation in C.
> But it seems that the 'weave.inline' will convert a 2d array in python into
> a 1d array in C.
> So if I have a MxN array 'arr'
> I need to access arr in C by the following code:
I think weave inline compiles code into C++ and links against the blitz
libraries, so that numpy arrays are blitz arrays. You can access the element
in your example as arr(2,3). For internal consumption, I guess that the
arrays are still chunks of memory.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User