Re: [Numpy-discussion] Numpy+SWIG with arrays in input and output of a function

2010-04-16 Thread Antoine Delmotte
Thank you very much for your help, Bill. It works perfectly now! On 16/04/10 02:07, Bill Spotz wrote: > Antoine, > > You want a python function with two python array arguments, therefore > you are dealing with two different typemaps, each of which requires > its own %apply directive: > > %apply (d

Re: [Numpy-discussion] Numpy+SWIG with arrays in input and output of a function

2010-04-15 Thread Bill Spotz
Antoine, You want a python function with two python array arguments, therefore you are dealing with two different typemaps, each of which requires its own %apply directive: %apply (double* IN_ARRAY1, int DIM1) {(double* vec , int m)}; %apply (double* ARGOUT_ARRAY1, int DIM1) {(double* vec

[Numpy-discussion] Numpy+SWIG with arrays in input and output of a function

2010-04-15 Thread Antoine Delmotte
Dear Numpy and SWIG users, I am currently trying to use SWIG and Numpy to launch C++ codes from python. My C++ code takes an array as an input (as well as integers, but this will be my next problem...) and returns a different array (with different dimensions). I have managed to make ve