Re: [eigen] Calculation of weighted norm

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


On 02.04.2012 10:14, Claas H. Koehler wrote:
Hi!

I was wondering about the best way to calculate the weighted square norm of a complex vector, i.e.

x^t A x

where x is a complex vector and A is a real diagonal matrix. [...]

If A is a diagonal, this is equivalent to:

	double norm2 = x.cwiseAbs2().cwiseProduct(A).sum();

assuming A is just the vector storing the diagonal entries.

If A is generic self-adjoint, the calculation will get more complex (pun intended).

Christoph

--
----------------------------------------------
Dipl.-Inf. Christoph Hertzberg
Cartesium 0.049
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/