The following code
cdef extern from "<complex.h>" nogil: #namespace "std" nogil:
double complex conj(double complex z)
float complex conjf(float complex z)
cpdef float complex [:,::1] Function_A ( int nf, int max_k, int [::1] ind_max_arr, float complex [:,::1] dft, float complex [::1] H_1st ):
cdef:
int i, k, ind_max
float complex [:,::1] OUT = np.zeros( [max_k, nf] , dtype=np.complex64 )
for i in range(nf):
ind_max = ind_max_arr[i]
for k in range(max_k):
if k < ind_max:
OUT[k, i] = dft[ ind_max, i ] * conjf( H_1st[ind_max - k] ) ### this line is problematic
else:
OUT[k, i] = dft[ ind_max, i ] * H_1st[k - ind_max]
return OUT
would fail during compilation with error: binary '*': '__pyx_t_float_complex' does not define this operator or a conversion to a type acceptable to the predefined operator.
The same Function A above would be successful if I switched everything to double complex and use conj. The error above refers to the line where conjf is used. Last I check complex.h does have the function conjf. Not sure what is wrong. Help please.
EDIT: Additional info: compiler: Microsoft Visual language: c++ (if i use c, even more errors)