[eigen] Complex number divided by real

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi everyone,
(first, I am using the dev branch)

I am trying to do something like (a.array() * b.array().conjugate()) / ( a.array().abs() * b.array().abs() ), where a and b are two VectorXcf. The problem is that (according to what I see) a.array().abs() returns a real vector rather than a complex one. So I can fix that by casting to std::complex<float> but that would incurr in a performance loss right?

I could normalize each value and then multiply, but I would have two divisions, and I don't even know if this 'element' normalization is possible with Eigen in its current state.

I know there are changes being done to the complex part so I guess this is a good point to ask about this. Maybe supporting complex divided by real would be good for certain operations. I could also save it to a complex and then take the result as a real vector that is twice the size of the complex ones but I guess that it would be a performance loss since there would be many unnecessary accesses to memory.

Thanks,
Carlos


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/