[SciPy-user] numpy array in ctype struct
Mon Jan 21 00:47:37 CST 2008
2008/1/21, Rob Hetland <firstname.lastname@example.org>:
> On Jan 20, 2008, at 10:01 AM, Matthieu Brucher wrote:
> > This function signature suppose that you will access an element by
> > data[i][j] which is not the way Numpy works.
> This seems to be the way the example attached by Paul Kienzle works,
> albeit for fixed size arrays. Would there be a way to dynamically
> set the size for the fixed array, based on other input integers?
No, in fact Paul's example uses  and this is coded by the compiler
like an int*.
> You can create a wrapper function that will allocate a double** 1D
> > array pointing to the adequate *double (start of a line), pass it
> > to your function and then deallocate the array when returning from
> > the function.
> Can you show an example? I tried to do something similar, but failed
> (due to poor coding skills..). Also, is it better to create the
> needed list of pointers on the python side, or the C side?
Definitely on the C side.
I'll try to give you an example today (but no promises)
French PhD student
Website : http://matthieu-brucher.developpez.com/
Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn : http://www.linkedin.com/in/matthieubrucher
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-user