Re: [Numpy-discussion] Problem in swig

2010-05-20 Thread Steven Nien
Hi Thanks for all your help! I found the "strange" result was caused by my algorithm(CUDA). The swig part is very ok:) On Thu, May 20, 2010 at 11:18 PM, Bill Spotz wrote: > I tried the following: > > %module example > %{ > #define SWIG_FILE_WITH_INIT > //#include "example.h" > %} > %include

Re: [Numpy-discussion] Problem in swig

2010-05-20 Thread Bill Spotz
I tried the following: %module example %{ #define SWIG_FILE_WITH_INIT //#include "example.h" %} %include "numpy.i" %init %{ import_array(); %} %apply (float* INPLACE_ARRAY1, int DIM1) {(float *a, int na), (float *b, int nb)}; %inline { void update_incident_field(int k, float *a, int n

Re: [Numpy-discussion] Problem in swig

2010-05-20 Thread Sebastian Haase
Hi, I don't know exactly, but try replacing the one line %apply (float* INPLACE_ARRAY1, int DIM1) {(float *a, int na), (float *b, int nb)}; with two lines: %apply (float* INPLACE_ARRAY1, int DIM1) {(float *a, int na)}; %apply (float* INPLACE_ARRAY1, int DIM1) {(float *b, int nb)}; Don't know abo

[Numpy-discussion] Problem in swig

2010-05-19 Thread Steven Nien
I want to pass 1 integer and 2 numpy array into the C function as followings: void update_incident_field(int k, float *a, int na, float *b, int nb) { for (i=0; i___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/li