Re: [eigen] Status of the eigen solver
• To: eigen@xxxxxxxxxxxxxxxxxxx
• Subject: Re: [eigen] Status of the eigen solver
• From: "Gael Guennebaud" <gael.guennebaud@xxxxxxxxx>
• Date: Thu, 25 Sep 2008 02:48:44 +0200
• Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=kAQjBuRQXCkh/gnjIKafxbZIcyuYP+n22Y7OM6epO0c+h1+Ds4j804Gq1/0HCzG84F dTF3kogF8u9IlXKmJYhXio4yQ5cSoUFwN5I3vpbqY4jPQuKvZfa2ODt2iV3rgiQGAvBt jJJYv3BWIse8gx15faQ3bWwwyhyz26LBfe3vs=

yes, in fact this piece of code has been borrowed from Jama, and they use a trick to keep the "eigenvectors" real.

so this is their notes:

If A is symmetric, then A = V*D*V' where the eigenvalue matrix D is
diagonal and the eigenvector matrix V is orthogonal. That is,
the diagonal values of D are the eigenvalues, and
V*V' = I, where I is the identity matrix.  The columns of V
represent the eigenvectors in the sense that A*V = V*D.

If A is not symmetric, then the eigenvalue matrix D is block diagonal
with the real eigenvalues in 1-by-1 blocks and any complex eigenvalues,
a + i*b, in 2-by-2 blocks, [a, b; -b, a].  That is, if the complex
eigenvalues look like
<pre>

u + iv     .        .          .      .    .
.      u - iv     .          .      .    .
.        .      a + ib       .      .    .
.        .        .        a - ib   .    .
.        .        .          .      x    .
.        .        .          .      .    y
</pre>
then D looks like
<pre>

u        v        .          .      .    .
-v        u        .          .      .    .
.        .        a          b      .    .
.        .       -b          a      .    .
.        .        .          .      x    .
.        .        .          .      .    y

This keeps V a real matrix in both symmetric and non-symmetric
cases, and A*V = V*D.

I guess it should be fairly easy to extract the "true" eigenvectors from the current ones, but unfortunately, I won't have time to look into it soon.

gael.

On Thu, Sep 25, 2008 at 2:33 AM, Timothy Hunter wrote:
For your information, the eigen values returned seem correct (as
checked with random matrices against matlab's computations). Also, the
computed eigen vectors have no imaginary part and are different.

On Wed, Sep 24, 2008 at 1:47 PM, Gael Guennebaud
<gael.guennebaud@xxxxxxxxx> wrote:
>
> ah, thanks for the fix. Actually it is supposed to work for non symmetric
> matrices. At least it worked a while ago. I'll check that when I'll have
> time....
>
> gael.
>
> On Wed, Sep 24, 2008 at 10:41 PM, Benoît Jacob <jacob@xxxxxxxxxxxxxxx>
> wrote:
>>
>> On Wednesday 24 September 2008 22:14:12 Timothy Hunter wrote:
>> > Hello,
>> > I would like to compute eigen values for non-symmetric matrices. I tried
>> > to
>> > use to the EigenSolver but it does not compile because it cannot find
>> > the
>> > function .block(int, int)  (see attached log).
>>
>> OK, this function was recently renamed to segment(int,int).
>> Fixed in r864468.
>>
>> > Also, the
>> > tests for non self-adjoint matrices are disabled in test/eigensolver.cpp
>> > .
>> > Does it mean this class is not ready yet?
>>
>> I tried re-enabling this test, and fixed it so it compiled, and the result
>> is
>> that with a real, non-selfadjoint matrix, the unit-test failed at line
>> 117.