[eigen] Array of complex numbers |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Hi Eigen users,
I’ve been given a code that needs to be optimized. The bottleneck is the linear algebra which is written with Eigen. It turns out that the code deals with complex (std::complex<float>) vectors whose order of magnitude is about 300. Only the following operations are used:
- Scalar product
- Linear combination
I managed to obtain quite a speedup (x2) using separate storage for the real and imaginary parts: instead of working with an array of std::complex<float>, I work with two arrays of float. The memory layout is changed and we get some speedup because it is better for vectorization.
Unfortunately, I had to rewrite all the code as this change of layout prevent me for working directly with std::complex<float>. And the initial coder is not really happy as the code got more complex.
It there a way to use this layout (structure of array instead of array of struct) with Eigen and a similar API?
Best regards,
François Fayard