Numpy cdouble structure

Numpy

typedef struct { double real, imag; } npy_cdouble;
typedef struct { float real, imag; } npy_cfloat;
typedef struct { npy_longdouble real, imag; } npy_clongdouble;

Python

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