Numpy cdouble structure
- numpy/npy_common.h at b592ec8029a3c11f47ff69a42cb5470f9e60cc43 · numpy/numpy · GitHub
- Complex Number Objects — Python 3.9.2 documentation
- numpy.i: a SWIG Interface File for NumPy — NumPy v1.20 Manual
- c - C99 complex casting - Stack Overflow
- std::complex - cppreference.com (see array oriented access)
Numpy
typedef struct { double real, imag; } npy_cdouble; typedef struct { float real, imag; } npy_cfloat; typedef struct { npy_longdouble real, imag; } npy_clongdouble;
typedef struct { double real; double imag; } Py_complex;
lapack_complex_double (netlib)
/* Complex types are structures equivalent to the * Fortran complex types COMPLEX(4) and COMPLEX(8). * * One can also redefine the types with his own types * for example by including in the code definitions like * * #define lapack_complex_float std::complex<float> * #define lapack_complex_double std::complex<double> * * or define these types in the command line: * * -Dlapack_complex_float="std::complex<float>" * -Dlapack_complex_double="std::complex<double>" */ ... #ifndef lapack_complex_double #include <complex.h> #define lapack_complex_double double _Complex #endif #ifndef lapack_complex_double_real #define lapack_complex_double_real(z) (creal(z)) #endif #ifndef lapack_complex_double_imag #define lapack_complex_double_imag(z) (cimag(z)) #endif