It's been some five decades ago I learned about eigenvalues en eigenvectors.
Now I was asked to solve a problem in which a matrix occurred of which both the
ev's had to be determined.
So I used Lapack, or to be more precise
\j903\addons\math\lapack2\example\dgeev.ijs
The matrix is
[t0=: 0 0 0 1 1, 0 0 1 0 1, 0 1 0 0 1, 1 0 0 0 1,:1 0 0 1 0
0 0 0 1 1
0 0 1 0 1
0 1 0 0 1
1 0 0 0 1
1 0 0 1 0
the result was
0 2 { do_dgeev t0
+------------+-------------------------------------------------------------------+
|_1 2 1 _1 _1| 0.78446454 0.19611614 0.19611614 _0.39223227
_0.39223227|
| | _0.4472136 _0.4472136 _0.4472136 _0.4472136
_0.4472136|
| |_1.468687e_16 _0.70710678 _0.70710678 _4.1962486e_17
_4.1962486e_17|
| | 0.0096089182 _0.31428262 _0.31428262 _0.63817416
0.62856525|
| | _0.31941072 _0.77239107 0.4148176 _0.038162751
0.35757347|
+------------+-------------------------------------------------------------------+
since I was only interested in the right eigenvectors.
Obviously, there are two 1-dimensional eigenspaces, with eigenvalue 1 and 2 and
one 3-dimensional with eigenvalue _1.
And, as dgeev.ijs reports, " The computed eigenvectors are normalized to have
Euclidean norm equal to 1 and largest component real."
I was glad with the eigenvalues, but less so with the vectors.
It is rather obvious, from inspecting the matrix, that 0 1 1 0 0 is an
eigenvector with eigenvalue 1, and since this value is unique, a multiple of
this vector had to occur as third vector in the solution matrix, QUOD NON.
However, if you do
0.01 round >2 { do_dgeev t0
0.78 0.2 0.2 _0.39 _0.39
_0.45 _0.45 _0.45 _0.45 _0.45
0 _0.71 _0.71 0 0
0.01 _0.31 _0.31 _0.64 0.63
_0.32 _0.77 0.41 _0.04 0.36
you immediately see the third row is the normalized eigenvector I was looking
for and the second row is the vector 1 1 1 1 1, belonging to evalue 2.
R.E. Boss
-----Original Message-----
From: Programming <[email protected]> On Behalf Of bill
lam
Sent: vrijdag 4 februari 2022 15:57
To: [email protected]
Subject: Re: [Jprogramming] j903/addons/math/lapack2/example/dgeev.ijs
That was copied from lapack documentation. Why did you think it is wrong?
http://www.netlib.org/lapack/explore-html/d9/d8e/group__double_g_eeigen_ga66e19253344358f5dee1e60502b9e96f.html
On Fri, 4 Feb 2022 at 5:41 PM R.E. Boss <[email protected]> wrote:
> This script says:
>
> NB. [out] VR If the j-th eigenvalue is real, then v(j)
> = VR(:,j),
> NB. the j-th column of VR.
>
> but it appears to be "the j-th ROW of VR"
>
>
> R.E. Boss
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm