|[eigen] Complex number divided by real|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Complex number divided by real
- From: Carlos Becker <carlosbecker@xxxxxxxxx>
- Date: Wed, 21 Jul 2010 18:33:25 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=c5MBRW//pV8FR6k3DmEvrLuwcZjmUPo1dySMHQfipfE=; b=Hi1F4vYCx3VyvKFdLc+CKRMbClrhpDP1if6CAaep9pMtr6/wQXf4/tqcIhNwEESvs3 CGTe0H26z0aPHhJyRTIR8Ia8Rqthk4hPnqfNSIzEpRtTYia88c3LI0wVgDk1j4z4XML8 FK48459usVvqJv5b+lhvSeAQVcYnxS8sPM8/w=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=fLKnhnsLdiBBeoRfHcMunlUkV65gQpqq/0LmDcZrpMOv5wPnZnnB/sOsmDbcdAvaV6 nfYYrsZdMOnXIIySAPEovWXRumMx2CXulF6qZaOLAY9UcGNNys6NBuL9r1g61c+St0AR S87+1sGD5wUYAAQqTYRVfS7EFr1EsxETj00VQ=
(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.