I've been learning to use Intel Math Kernel Library. Everything has been fine until now when I require to efficiently:
- Multiply an array of doubles by an array of MKL_Complex16s.
- Compute the exponential of iy where y is an array of doubles.
Specifically, I require to perform a = x * exp(iy) where x and y are arrays of doubles of the same size, and a should be an array of MKL_Complex16.
Since MKL_Complex16 = struct { double real, imag } I can manually make new arrays of MKL_Complex16 and write the real values to the real member, but that seems incredibly inefficient. This calculation is required to be performed thousands of times. I can also manually compute the exponential as sine and cosine, and again use a loop, but that isn't good either. Perhaps there is a routine that can copy into only the "real" member, but because of possible padding of the structure, I don't think that would work.
Both x and y arrays are evaluated efficiently, but how can I calculate "a" efficiently? (This is to to part of the input to a reverse FFT using MKL).
Thank you!