Dear all,
I have a rather simple question but this comes so often that I want to understand it a bit generally.
I have a fused type
ctypedef fused lapack_t:
float
double
(float complex)
(double complex)
and I would like to get the square root of the argument of lapack_t type. Obviously if the first two are negative I have to provide a simple machinery to cast them as complex and send it to csqrt. I am not sure if this is going to be handled in Cython 3 better with overloading (say, like "abs") but for now all I can find online is to read from complex.h or to get it from libc or libcpp.
This gets slightly complicated because if I do that import I get messages like the following
_cython_magic_86a41435db5ca7ce33368ba3df64c3b7.c
c:\users\ilhan\appdata\local\programs\python\python39\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
C:\Users\ilhan\.ipython\cython\_cython_magic_86a41435db5ca7ce33368ba3df64c3b7.c(1297): error C2061: syntax error: identifier '__pyx_t_float_complex'
C:\Users\ilhan\.ipython\cython\_cython_magic_86a41435db5ca7ce33368ba3df64c3b7.c(1297): error C2059: syntax error: ';'
C:\Users\ilhan\.ipython\cython\_cython_magic_86a41435db5ca7ce33368ba3df64c3b7.c(1302): error C2061: syntax error: identifier '__pyx_t_float_complex_from_parts'
C:\Users\ilhan\.ipython\cython\_cython_magic_86a41435db5ca7ce33368ba3df64c3b7.c(1302): error C2059: syntax error: ';'
C:\Users\ilhan\.ipython\cython\_cython_magic_86a41435db5ca7ce33368ba3df64c3b7.c(1302): error C2059: syntax error: '<parameter-list>'
C:\Users\ilhan\.ipython\cython\_cython_magic_86a41435db5ca7ce33368ba3df64c3b7.c(1309): error C2061: syntax error: identifier '__pyx_t_double_complex'
Might be the fact that it is picking up MSVC somehow or some other problem happening here. But just to keep it in scope, and apart from these complications, I'd like to ask how the generic way to handle these libc and libcpp imports pre v3.0. Because it seems like they are not in the includes in the 0.29.x series but they are in master branch.
As you can tell I confused myself quite a bit about this point and would like to ask for some canonical way or any guidance.
Thanks in advance.