Problem with complex and double numbers

So, I am writing a code where I have to use matrices of complex numbers.

Till now, I declared these matrices as arrays of double numbers and I assume that two consecutive elements in the array are the real and imaginary part of the same complex number.

This is useful because in my code I have to compute the FFT of these matrices, and there are C++ libraries that do the FFT easily when the data have the structure I just described (i.e., I repeat, each matrix is stored column-wise in an array and each complex element of the matrix is split into two consecutive double numbers in the array, the real and imaginary part).

This structure I am using works for the FFT.

Now I have to compute matrices product. Can I use a function like zgemm that operates on complex arrays with my array of doubles? Or how should I do?
Where possible, use standard C++. i.e. the (now) built-in complex<double>.

Those libraries sound like C-libraries, where C didn't have a complex-number type. I should find yourself some better FFT libraries.
You could use structs or classes to represent the complex numbers. Or even just use the <complex> library and it's associated functions. I know that stack exchange actually has a section on computational science where they have some great tips. They could probably suggest some libraries to use.

https://scicomp.stackexchange.com
Topic archived. No new replies allowed.