Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | /* |
2 | * C complex typemaps | |
3 | * ISO C99: 7.3 Complex arithmetic <complex.h> | |
4 | */ | |
5 | ||
6 | ||
7 | %include <pycomplex.swg> | |
8 | ||
9 | %{ | |
10 | #include <complex.h> | |
11 | %} | |
12 | ||
13 | ||
14 | /* C complex constructor */ | |
15 | #define CCplxConst(r, i) ((r) + I*(i)) | |
16 | ||
17 | %swig_cplxflt_convn(float complex, CCplxConst, creal, cimag); | |
18 | %swig_cplxdbl_convn(double complex, CCplxConst, creal, cimag); | |
19 | %swig_cplxdbl_convn(complex, CCplxConst, creal, cimag); | |
20 | ||
21 | /* declaring the typemaps */ | |
22 | %typemap_primitive(SWIG_TYPECHECK_CPLXFLT, float complex); | |
23 | %typemap_primitive(SWIG_TYPECHECK_CPLXDBL, double complex); | |
24 | %typemap_primitive(SWIG_TYPECHECK_CPLXDBL, complex); |