#ifndef __cplusplus

/* C99 */
#include <complex.h>
typedef complex             __Pyx_complex_t;
#define __Pyx_creal(z)     (creal(z))
#define __Pyx_cimag(z)     (cimag(z))
#define __Pyx_complex(r,i) ((r)+_Complex_I*(i))

#else

/* C++ */
#include <complex>
typedef std::complex<double> __Pyx_complex_t;
typedef __Pyx_complex_t      complex;
#define __Pyx_creal(z)       ((z).real())
#define __Pyx_cimag(z)       ((z).imag())
#define __Pyx_complex(r,i)   (__Pyx_complex_t((r),(i)))

#endif

static inline PyObject *__pyx_PyComplex_FromCComplex(__Pyx_complex_t z)
{
  return PyComplex_FromDoubles(__Pyx_creal(z), __Pyx_cimag(z));
}

static inline __Pyx_complex_t __pyx_PyComplex_AsCComplex(PyObject *ob)
{
  Py_complex z = ((PyComplexObject *)ob)->cval;
  return __Pyx_complex(z.real, z.imag);
}
