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 12:25:23 +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=V0nRmwewZwq1jzFZk89tGTEIs9A54fD5G+B9K62ZU3kHp7zw7YMVecy3/IClp8EQRN aakM8N/x09XsPekTwt65T7HN0AW81CzOlVCCq1drO8nY8DriDlTm7h3yIDtuH2FeGWL7 AzYrsT4m+wAF5FttKPfUe0UA7opd5ppDIpCg8=

Nice idea, but .rowwise().normalized() doesn't compile.
I guess that normalized() hasn't been coded into row or col-wise ops, since this doesn't work either:

MatrixXf nn;
VectorXf    a,b;
b = nn.colwise().normalized();

cheers

On Wed, Jul 21, 2010 at 11:17 PM, Christoph Hertzberg 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();

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/