In Cython, starting from a C++ vector of std::complex<double>
like this...
# Imports
from libcpp.vector cimport vector
from libcpp.complex cimport complex as cpp_complex
ctypedef my_complex = cpp_complex[double]
# Code
cdef vector[my_complex] vec
... how can I convert this vector to a double complex
memoryview with the default cython/python's complex
?
cdef complex[::1] mem_view = ???
Alternatively, how can I tell Cython to use C++'s std::complex<double>
instead of double complex
as the underneath type of complex
?