Re: [eigen] Complex number divided by real
• To: eigen@xxxxxxxxxxxxxxxxxxx
• Subject: Re: [eigen] Complex number divided by real
• From: Carlos Becker <carlosbecker@xxxxxxxxx>
• Date: Thu, 22 Jul 2010 09:59:19 +0100
• Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=gT0qNh1rPJ5Dto/hTtUmP/usC8CJI2AHV8oe0ShsUiNY+hr9NG2hfDxBjdHx5RvCuc ClFvu8uJHE363GWzreFtHqciH4lziN0p0YctkHM2WHmRWkT9Y2/HRlgqAkDeN550mGTt DcbyMWcmX1qdq1fQD7qla+PQPEzwFo5ZyYMyc=

Oh ok then it makes sense. I will be glad to try it and see if there is any significant speed improvement (which I guess there should be).

Thanks a lot!
Carlos

On Thu, Jul 22, 2010 at 6:54 AM, Gael Guennebaud wrote:
On Thu, Jul 22, 2010 at 12:17 AM, Christoph Hertzberg
<chtz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> Carlos Becker 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.
>
> Wouldn't something like this work in your case? (I didn't actually try it
> ...)
>
> (a.array() * b.array().conjugate()).rowwise().normalized();

there is no such vectorwise normalized() function yet, but it could be

Now to answer new related Carlos's trouble:

[23:56] <artz> I was trying something different now and doesn't seem to work
[23:57] <artz> like this: VectorXf a; VectorXcf b,c;  c = b.array() *
a.array().inverse()
[23:57] <artz> should it work?

Yes it should ;) With default branch it indeed fails to compile, with
my "complex" fork it does work fine.

Actually I'm tempted to do the merge today since here all tests
succeed with gcc on both a 64 and 32 bit systems...

gael

>
> Because:
> abs(a)*abs(b) = abs(a)*abs(conj(b)) = abs(a*conj(b))
>
> Actually, an elementwise signum function would be helpful in that case..
>
>
>
> --
> ----------------------------------------------
> Dipl.-Inf. Christoph Hertzberg
> Cartesium 0.051
> Universität Bremen
> Enrique-Schmidt-Straße 5
> 28359 Bremen
>
> Tel: (+49) 421-218-64252
> ----------------------------------------------
>
>
>

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