[SciPy-User] Problem with passing a 2D Numpy array in the C code by weave.inline

Steven Nien steven.nien@gmail....
Thu Dec 3 02:22:03 CST 2009


Hello,
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[2][3] in C by the following code:
"""
arr[2*N+3] = 0;
"""
What I want is accessing the array by the original syntax in C , i.e.,
'arr[2][3] = 0;'
Since I have lot's of legacy 2D-array code write in C,  I don't wan't use
the Blitz method.
And I still want to use the 'weave.inline' function.

Does anyone have any idea?

Regards,
Steven Nien
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20091203/3e0dbe08/attachment.html 


More information about the SciPy-User mailing list