Re: [eigen] Eigenvalues and eigenvectors of 2x2 self-adjoint matrix
• To: eigen@xxxxxxxxxxxxxxxxxxx
• Subject: Re: [eigen] Eigenvalues and eigenvectors of 2x2 self-adjoint matrix
• From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
• Date: Sat, 30 Jun 2012 22:03:55 +0200
• Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=pOcs+SW5BMeZzeUY3kNtOpxM4YRmWPlFl2QTnFfBtgc=; b=g0/W9fYUVUM7JYJ0TMZC4fEqx8CguRv8Tuisfg6lXLtl/ZG9TVYWkGUwQe4FoqLD7h TPfVWmvrgHbrU2/umH/2CAjbkiJb2L4v6I+Eyb4rUErpaWWA06meh/j7qctd5xiffowe TZjG1R+dCc5JZRC2Howwio1DO2ZYgVE0cwEtVfVzlrYNw0wN1co9uHhJDvZ2wrs07GFY sgDQQCDPxTbPlrNA5/ajluJDSnXEWQiUwvalVPUc8sijveLGm7J5Ah9yBmsQs+RRsnw6 ZfBxQNE3lfheheW0Rmm4Am9MYzDp9nMtn442esm9LMnXFAWznB2yIB/UzMiuZAKbeeGf GGtg==

```Hi,

there is a directCompute() method that does perform the decomposition
using closed form formulas for 2x2 and 3x3 real matrices.

Maybe the 2x2 algorithm could be used by default if it appears to be
100% reliable, that is clearly not the case for the 3x3 case.

gael

On Sat, Jun 30, 2012 at 8:49 PM, Alexey Korepanov <khumarahn@xxxxxxxxx> wrote:
> Hello.
>
> I am comparing precision of computation of eigenvectors and eigenvalues of
> eigen and matlab. I started with a simple 2x2 self-adjoint case, working
> with long double datatype.  The best method seems to be.. "by hand": solving
> the quadratic equation for eigenvalues, and then computing eigenvectors.
> Both matlab and eigen are slower and give less precise results. As a measure
> of precision I take Frobenius norm of AV-VD, where A is original matrix, V
> is matrix of eigenvectors, D is diagonal matrix of eigenvalues.
>
> Difference in precision is probably not a very big deal (like 4 last bits in
> long double), but it would be interesting to understand what eigen does to
> compute the decomposition for self-adjoint 2x2 matrix. It looks like eigen
> gives least precise results when discriminant of equation for eigenvalues is
> large. Can somebody comment on this?
>
> Best
>
>

```

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