Hi, I need to pass a Numpy array to a C code wrapped by Swig. The array in the C code is a global variable declared as double *vec and I would like to set it in the calling Python module foo using e.g. foo.cvar.vec = numpy.zeros(10) so that the array is manipulated in place.
I found out the examples in the numpy/doc/swig dir and adapted them to my code, so now I can pass a Numpy array to a function. But in the examples I was not able to recognize any suggestion (any typedef?) to translate an array into a variable. I'm just writing an intermediate function that does the job, but I feel like writing a wrapping function that will be wrapped again by Swig... Any practical example is highly appreciated! Regards, Andrea _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
