I initialize a matrix like below but seem to keep getting this error. I don’t understand why though, because I know this is running for several other people. What could possibly be causing this issue? Note that I have seen a very similar question, but I’m not sure I understand how to fix the issue yet. I am running this with c++14 and I tried c++17 (which I know for a fact worked for someone else), and I am linking the correct libraries as well.
lapack_complex_double *a = (std::complex<double> *)malloc(sizeof(std::complex<double>) * ma * na);
I worried it may have been because of how I fill the matrix (since that kept throwing an error too):
error: cannot convert ‘std::complex<double>’ to ‘__complex__ double’ in assignment
a[k] = 0.5 - (double)rand()/(double)RAND_MAX + std::complex<double>(0, 1)* (0.5 - (double)rand()/(double)RAND_MAX);
but this error shows up for empty matrices as well.
Could anyone possibly help me figure out what I can add to my code to remove this issue?