[Numpy-discussion] numpy.i and std::complex

Sturla Molden sturla.molden at gmail.com
Mon Oct 27 11:45:49 EDT 2014

Glen Mabey <gmabey at swri.org> wrote:
> I'd really like for this to be included alongside numpy.i -- but maybe I
> overestimate the number of numpy users who use complex data (let your
> voice be heard!) and who also end up using std::complex in C++ land.

I don't think you do. But perhaps you overestimate the number of NumPy
users who use Swig?

Cython seems to be the preferred wrapping tool today, and it understands
complex numbers:

    cdef double complex J = 0.0 + 1j

If you tell Cython to emit C++, this will result in code that uses


More information about the NumPy-Discussion mailing list