Re: [eigen] Complex number divided by real
• To: eigen@xxxxxxxxxxxxxxxxxxx
• Subject: Re: [eigen] Complex number divided by real
• From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
• Date: Wed, 21 Jul 2010 23:52:11 +0200
• Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=MaOUTeXP53PC9+9uzXJdHoNPzGtPv/jRMXLMKUxCxxzBafzb1WUxbSX7ER1+7mhRiG GfEeKCDjiy3FHS2FrG/EXJe+gAu4UlYQw9YVJmAWEpkwpaOud+3TY2wewasavakBuN3q aZmsWyQKMTnEufJwTgwAm1ZWFARy7aA09XoVY=

```for the record, let me just paste what I've replied on IRC:

[19:34] <ggael> artz: currently yes you have to do the cast but for
beta2 this will work just fine doing a complex/real division.
[19:34] <ggael> hm, actually the following should work too:
[19:35] <ggael> (complex array) * (real array).inverse()
[19:35] <ggael> the trick is that operator* already works for mixed
complex*real coefficient-wise product

gael.

On Wed, Jul 21, 2010 at 7:33 PM, Carlos Becker <carlosbecker@xxxxxxxxx> wrote:
> 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