ccomplex.i 763 B

1234567891011121314151617181920212223242526
  1. /* -----------------------------------------------------------------------------
  2. * ccomplex.i
  3. *
  4. * C complex typemaps
  5. * ISO C99: 7.3 Complex arithmetic <complex.h>
  6. * ----------------------------------------------------------------------------- */
  7. %include <pycomplex.swg>
  8. %{
  9. #include <complex.h>
  10. %}
  11. /* C complex constructor */
  12. #define CCplxConst(r, i) ((r) + I*(i))
  13. %swig_cplxflt_convn(float complex, CCplxConst, creal, cimag);
  14. %swig_cplxdbl_convn(double complex, CCplxConst, creal, cimag);
  15. %swig_cplxdbl_convn(complex, CCplxConst, creal, cimag);
  16. /* declaring the typemaps */
  17. %typemaps_primitive(SWIG_TYPECHECK_CPLXFLT, float complex);
  18. %typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, double complex);
  19. %typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, complex);