Algebraic Eigenvalue Problem Algebraic Eigenvalue Problem
Computers are useless. They can only give answers. Pablo Picasso
1
Algebraic Eigenvalue Problem Algebraic Eigenvalue Problem Computers - - PowerPoint PPT Presentation
Algebraic Eigenvalue Problem Algebraic Eigenvalue Problem Computers are useless. They can only give answers. Pablo Picasso 1 Fall 2010 Topics to Be Discussed Topics to Be Discussed This unit requires the knowledge of eigenvalues This
Computers are useless. They can only give answers. Pablo Picasso
1
2
3
4
d d ⎡ ⎢ ⎢ ⎤ ⎥ ⎥
1 2
A dn = ⎢ ⎢ ⎢ ⎢ ⎢ ⎥ ⎥ ⎥ ⎥ ⎥
−1
dn ⎣ ⎢ ⎦ ⎥
( )( ) ( )( ) d d d d
n n 1 2 1
− − − − =
−
…
5
6
7
8
9
10
11
12
z = random and scaled vector ! initialize DO ! loop until done w = A*z max = 1 ! find the |max| entry | | DO i = 2, n IF (ABS(w(i)) > ABS(w(max))) max = i END DO END DO eigen_value = w(max) ! ABS(w(max)) the largest DO i = 1, n ! Scale w(*) to z(*) z(i) = w(i)/eigen value z(i) = w(i)/eigen_value END DO IF (ABS(A*z – eigen_value*z)) < Tol) EXIT END DO
13
END DO
11 26 3 12 − − ⎡ ⎤ 3 12 3 6 31 99 15 44 − − − − ⎡ ⎢ ⎢ ⎢ ⎢ ⎤ ⎥ ⎥ ⎥ ⎥
9 10 3 4 − − − ⎣ ⎢ ⎢ ⎦ ⎥ ⎥
14
15
2 1 1 2
16
17
θ
18
sin( ) cos( ) y y θ θ ⎣ ⎦ ⎣ ⎦ ⎣ ⎦
1 ⎡ ⎤ ⎢ ⎥ ⎢ ⎥
cos( ) sin( ) θ θ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
,
cos( ) sin( ) ( ) 1 sin( ) cos( )
p q
R θ θ θ θ θ ⎢ ⎥ ⎢ ⎥ = ⎢ ⎥ − ⎢ ⎥
sin( ) cos( ) 1 θ θ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
19
1 ⎢ ⎥ ⎢ ⎥ ⎣ ⎦
20
21
1 ⎡ ⎤ ⎡ ⎤ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
1 C S a a ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
, ,
1
i p i q
a a A R ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
1 S C ⎢ ⎥ ⎢ ⎥ − ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
22
1 ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎣ ⎦ ⎣ ⎦
a C a S a S a C − + ⎡ ⎤
1, 1, 1, 1, 2, 2, 2, 2, p q p q p q p q
a C a S a S a C a C a S a S a C + ⎡ ⎤ ⎢ ⎥ − + ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
, , , , p p p q p p p q
a C a S a S a C A R ⎢ ⎥ − + ⎢ ⎥ ⎢ ⎥
⎥ ⎢ ⎥
, , , , q p q q q p q q
a C a S a S a C a C a S a S a C ⎢ ⎥ − + ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ − + ⎢ ⎥
1, 1, 1, 1, , , , , n p n q n p n q n p n q n p n q
a C a S a S a C a C a S a S a C
− − − −
+ ⎢ ⎥ ⎢ ⎥ − + ⎣ ⎦
1 1
T
⎡ ⎤ ⎡ ⎤ ⎢ ⎥ ⎢ ⎥ 1 1 ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
1
T
C S C S R S C S C ⎢ ⎥ ⎢ ⎥ − ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ = = ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ 1 1 S C S C ⎢ ⎥ ⎢ ⎥ − ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
1 1 ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎣ ⎦ ⎣ ⎦
1 ⎡ ⎤ ⎡ ⎤ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
1 C S ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ − ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
, ,
1
p i p j T
a a R H ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
, ,
1
q i q j
S C a a ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
25
1 ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎣ ⎦ ⎣ ⎦
1, 1, 1, 1, 2, 2, 2, 2, p q p q p q p q
a C a S a S a C a C a S a S a C − + − + ⎡ ⎤ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
' ' ,1 ,1 ,2 ,2 , , , , p q p q p p p q p n q n T
a C a S a C a S A A a C a S R A R − − −
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
i,j i,j
' ' ,1 ,1 ,2 ,2 , , , , 1 1 1 1 p q p q q p q q p n q n
a S a C a S a C A A a S a C a C a S a S a C + + + − +
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
1, 1, 1, 1, , , , , n p n q n p n q n p n q n p n q
a C a S a S a C a C a S a S a
− − − −
+ − + C ⎢ ⎥ ⎢ ⎥ ⎣ ⎦
' 2 2
Because of symmetry, we only
' 2 2 , , , , ' 2 2 , , , ,
p p p p p q q q q q p p p q q q
update the upper triangular part.
26
, , , , ' ' 2 2 , , , , , q q p p p q q q p q q p p p q q p q
A a C a C S a S A a S a C S a C
p p p p p q p q q q p p p q p q , ' , . , '
= − × + = + × +
2 2 2 2
2 2
! PART I: Update a(p p) a(q q) a(p q)
A A a a C S a C S
q q p p p q p q p q q p p p q q p q , , . , , ' , ' , , ,
( ) ( ) = = − × + −
2 2
! PART I: Update a(p,p), a(q,q), a(p,q) ! C = cos(θ) and S = sin(θ) ! a(*,*) is an n×n symmetric matrix ! p, q : for (p,q)-rotation, where p < q
p q
! p, q : for (p,q) rotation, where p < q App = C*C*a(p,p) – 2*C*S*a(p,q) + S*S*a(q,q) Aqq = S*S*a(p,p) + 2*C*S*a(p,q) + C*C*a(q,q)
p
qq (p,p) (p,q) (q,q) Apq = C*S*(a(p,p)-a(q,q)) + (C*C-S*S)*a(p,q) a(p,p) = App a(q,q) = Aqq
q
27
a(p,q) = Apq
A a C a S A a S a C
i p i p i q , ' , , '
= − = +
! PART II: Update column p and column q from ! row 1 to row p-1.
A a S a C
i q i p i q , , ,
= +
! row 1 to row p 1. ! ! h is used to save the new value of a(i,p) ! since a(i,p) is used to compute a(i,q)
p q
! since a(i,p) is used to compute a(i,q) ! and cannot be destroyed right away! DO i = 1, p-1
p
p h = C*a(i,p) – S*a(i,q) a(i,q) = S*a(i,p) + C*a(i,q) a(i,p) = h
q
28
END DO
i p i p i q , ' , , '
= − +
! PART III: Update the portion between ! row p+1 and row q-1 ! i
p q
i q i p i q , , ,
= +
! h is used to save the new value ! of a(p,i) because a(p,i) is used ! to compute a(i,q) and cannot be ! d t d i ht !
p
! destroyed right away! DO i = p+1, q-1 h = C*a(p i) S*a(i q)
q
h = C*a(p,i) – S*a(i,q) a(i,q) = S*a(p,i) + C*a(i,q) a(p,i) = h END DO a(p,i) a(i,q)
29
END DO
! PART IV: Update column q+1 to column n ! h i d h l
A a C a S
i p i p i q , ' , ,
= −
! h is used to save the new value ! of a(p,i) because a(p,i) is used to ! compute a(q,i) and cannot be ! d t d i ht !
p q
A a S a C
i q i p i q , ' , ,
= +
! destroyed right away! ! Due to symmetry, this part actually ! updates the last sections of row p ! and Row q
p q p
! and Row q DO i = q+1, n h = C*a(p,i) – S*a(q,i)
p q
h = C a(p,i) S a(q,i) a(q,i) = S*a(p,i) + C*a(q,i) a(p,i) = h END DO
30
END DO
1,1 1,2
1 2 2 1
2,1 2,2
1,2 2,1
A R A R a C a C S a S a a C S a C S
T
'
, , , , , ,
− × + − × + − ⎡ ⎢ ⎤ ⎥
1 1 2 1 2 2 2 2 1 1 2 2 1 2 2 2
2
A R A R a S a C S a C '
, , , , , , , , ,
= ⋅ ⋅ = + × + ⎣ ⎢ ⎢ ⎦ ⎥ ⎥
1 1 2 1 2 2 2 2
2
31
a a C S a C S
1 1 2 2 1 2 2 2 , , ,
− × + −
( )
( )
2 2 1,1 2,2 1,2
a a C S a C S − × + − = ⇓
simple facts from trigonometry
1,2 2 2 2 2 1,1 2,2
cos( )sin( ) cos ( ) sin ( ) a C S a a C S θ θ θ θ − × = = − − − ⇓
sin( ) sin( )cos( ) cos( ) cos ( ) sin ( ) 2 2 2
2 2
θ θ θ θ θ θ = = −
simple facts from trigonometry
1,2 2 2 2,2 1,1
2 cos( )sin( ) 1 sin(2 ) tan(2 ) 2 cos ( ) sin ( ) 2 cos(2 ) 2 a a a θ θ θ θ θ θ θ ⇓ = × = = − − ⇓
32
1,2 2,2 1,1
2 tan(2 ) a a a θ ⇓ = −
θ = − ⎛ ⎝ ⎜ ⎞ ⎠ ⎟
−
1 2 2
1 1 2 2 2 1 1
tan
, , ,
a a a
if a1,1 ≠ a2,2
A = ⎡ ⎣ ⎢ ⎤ ⎦ ⎥ 2 3 3 4
⎣ ⎦
33
⎡ ⎤ ⎡ ⎢ ⎤ ⎥ 1 3 R C S S C = − ⎡ ⎣ ⎢ ⎤ ⎦ ⎥ = − ⎣ ⎢ ⎢ ⎢ ⎢ ⎦ ⎥ ⎥ ⎥ ⎥ 2 2 3 2 1 2
⎡ ⎢ ⎤ ⎥ ⎡ ⎤ ⎡ ⎢ ⎤ ⎥ 1 3 1 3 A R A R
T
'= ⋅ ⋅ = − ⎣ ⎢ ⎢ ⎢ ⎢ ⎦ ⎥ ⎥ ⎥ ⎥ ⋅ ⎡ ⎣ ⎢ ⎤ ⎦ ⎥ ⋅ − ⎣ ⎢ ⎢ ⎢ ⎢ ⎦ ⎥ ⎥ ⎥ ⎥ = ⎡ ⎣ ⎢ ⎤ ⎦ ⎥ 2 2 3 2 1 2 2 3 3 4 2 2 3 2 1 2 1 5
⎣ ⎢ ⎦ ⎥ ⎣ ⎢ ⎦ ⎥ 2 2 2 2
34
35
T⋅A0⋅R1 becomes 0.
T⋅A1⋅R2 becomes 0.
2 2 1 2 2 1 1 2 T T T
36
2 2 1 1 2 T T
T⋅Ai-1⋅Ri .
i i i 1 i
T T T T
1 2 1 1 2 1 T T T T i i i i i
− −
37
DO p = 1 find max off-diagonal entry p q = 2 DO i = 1, n DO j = i+1 n find max off-diagonal entry DO j = i+1, n IF (ABS(a(p,q)) < ABS(a(i,j)) THEN p = i q j q = j END IF END DO END DO IF (ABS(a(p,q)) < Tol) EXIT Apply a (p,q)-rotation to matrix a(*,*)
38
END DO
39
p,p, q,q p,q
' 2 2 , , , ,
p p p p p q q q
' 2 2 , , , , ' ' 2 2
q q p p p q q q
, , , , , p q q p p p q q p q
40
2 2 , , , , p q p p q q p q
A a a C S a C S = − × + − =
,
cos( )sin( ) 2 cos( )sin( )
p q
a C S θ θ θ θ ⇓ × ×
, 2 2 2 2 2 2 , ,
( ) ( ) ( ) ( ) cos ( ) sin ( ) 2 cos ( ) sin ( )
p q q q p p
a a C S θ θ θ θ = = = × − − − − ⇓
,
1 sin(2 ) 1 tan(2 ) 2 cos(2 ) 2
p q q q p p
a a a θ θ θ ⇓ = × = −
, ,
( ) 2
q q p p
a a a ⇓ −
41
, , , , , ,
2 tan(2 ) cot(2 ) 2
p q q q p p q q p p p q
a a a a a a θ θ = ⇒ = −
2 2 2 2
cos(2 ) cos ( ) sin ( ) cot(2 ) sin(2 ) 2sin( )cos( ) 2 C S S C θ θ θ θ θ θ θ − − = = = ×
sin(2 ) 2sin( )cos( ) 2S C θ θ θ ×
2 2 2 2 2 2 2
( ) / 1 / 1 cot(2 ) C S C S C t θ − − − = = =
2
( ) (2 ) / 2( / ) 2 S C C S C t ×
2
, ,
q q p p
42
,
p q
2
43
2 2 2 2
1 1 1 −∆ ∆ + −∆ ± ∆ + × = ∓
avoid cancellation
2 2
1 1 −∆ ∆ + ∆ ± ∆ + ∓
44
2
2
2
45
Compute ∆ and t, and obtain C=cos(θ) and S=sin(θ) ! This section computes C and S ! From a(p,p), a(q,q) and a(p,q) t = 1.0 t 1.0 IF (a(p,p) != a(q,q)) THEN D = (a(q,q)-a(p,p))/(2*a(p,q)) t = SIGN(1/(ABS(D)+SQRT(D*D+1)) D) t = SIGN(1/(ABS(D)+SQRT(D*D+1)),D) END IF C = 1/SQRT(1+t*t) S C*t S = C*t In Fortran 90, SIGN(a,b) means using the sign of b with the absolute value
46
and SIGN(-15,1) yield
DO Find the max |a(p,q)| entry, p < q IF (|a(p,q)| < Tol) EXIT | | From a(p,p), a(q,q) and a(p,q) compute t From t compute C and S Perform a (p,q)-rotation with a(p,q)=a(q,p)=0
47
Perform a (p,q) rotation with a(p,q) a(q,p) 0 END DO
12 6 6 6 16 2 A − ⎡ ⎤ ⎢ ⎥ = ⎢ ⎥
6 2 16 ⎢ ⎥ ⎢ ⎥ − ⎣ ⎦
2,2 1,1 1,2
48
1,2
T⋅A⋅R1 2 is 1,2 1,2
eliminated
49
1,3
1,3
0.885334
1 R ⎡ ⎤ ⎢ ⎥ = ⎢ ⎥
T⋅A⋅R1,3 is
0.46495553 0.885334 ⎢ ⎥ ⎢ ⎥ ⎣ ⎦
1,3 1,3
eliminated was 0!
li i hi i h i i
50
eliminate this one in the next iteration
2,3
2,3
51
T⋅A⋅R2,3 is:
They were 0!
2,3 2,3 4.505028
21.51395 0.0 A ⎡ ⎤ ⎢ ⎥ = ⎢ ⎥
eliminated
17.98103 ⎢ ⎥ ⎢ ⎥ ⎣ ⎦
4.455996 ⎡ ⎤ ⎢ ⎥ 21.54401 18.0 A ⎢ ⎥ = ⎢ ⎥ ⎢ ⎥ ⎣ ⎦
52
1 1 ⎡ ⎤ ⎡ ⎤
identity matrix
1 1 C S C S ⎡ ⎤ ⎡ ⎤ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
1
T
C S C S R R I − ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ = = ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
i
1 S C S C ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ − ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
1 1 ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎣ ⎦ ⎣ ⎦
R R R R A R R R R D
m T m T T T m m
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ =
− −
1 2 1 1 2 1
m T m T T T m m
− −
1 2 1 1 2 1
1 2 1 1 2 1
T m m m m
− −
54
1 2 m
1 1 1 1 1
− − − − −
1 2 2 1
m m
1 1 1 1 T T T T T
− − − −
2 1 2 1 1 2 m m m
− ⋅
1
−1
55
1, 2,
n (
i i i,
1,1 1,2 1, 1 1, 1 2,1 2,2 2, 1 2, 2 n n n n
v v v v d v v v v d
− −
⎡ ⎤ ⎡ ⎤ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
[ ]
1 1 2 2 1,1 1,2 1, 1 1, 1
v | v | | v
n n n n n n n n n
d d d v v v v d d
− − − − − −
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⋅ = ⋅ ⋅ ⋅ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎣ ⎦ ⎣ ⎦
,2 , 1 , n n n n n n n
v v v v d
−
⎢ ⎥ ⎢ ⎥ ⎣ ⎦ ⎣ ⎦
56
! A is the input n×n symmetric matrix V = the identify matrix DO DO find the largest off-diagonal entry |a(p,q)| IF (|a(p,q)| < Tol) EXIT ∆ d compute ∆, t, S and C update matrix a(*,*) V = V*R ! eigenvectors END DO ! Eigenvalues are the diagonal entries of A ! Eigenvectors are the columns of V
57
1, 1, 1, 1, p q p q
v C v S v S v C C S S C − + ⎡ ⎤ ⎢ ⎥ +
2, 2, 2, 2, p q p q p p p q p p p q
v C v S v S v C v C v S v S v C ⎢ ⎥ − + ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ − + ⎢ ⎥
, , , , , , , , p p p q p p p q q p q q q p q q
C S S C V R v C v S v S v C ⎢ ⎥ ⎢ ⎥
⎥ − + ⎢ ⎥ ⎢ ⎥
1, 1, 1, 1, n p n q n p n q
v C v S v S v C C S S C
− − − −
⎢ ⎥ ⎢ ⎥ − + ⎢ ⎥ ⎢ ⎥ + ⎣ ⎦
58
, , , , n p n q n p n q
v C v S v S v C ⎢ ⎥ − + ⎣ ⎦
12 6 6 6 16 2 A − ⎡ ⎤ ⎢ ⎥ = ⎢ ⎥
6 2 16 ⎢ ⎥ ⎢ ⎥ − ⎣ ⎦
1,2
0.8112422 0.5847103
0.8112422 1 R ⎡ ⎤ ⎢ ⎥ = ⎢ ⎥ ⎢ ⎥
1 ⎢ ⎥ ⎣ ⎦
⎡ ⎤ 08112422 05847103 V I R = ⋅ = − ⎡ ⎢ ⎢ ⎢ ⎤ ⎥ ⎥ ⎥
1 2
08112422 05847103 05847103 08112422 1
,
. . . .
59
⎣ ⎢ ⎦ ⎥ 1
7.6754445 0.0
20.32456
A ⎡ ⎤ ⎢ ⎥ = ⎢ ⎥
16.0 ⎢ ⎥ ⎢ ⎥ ⎣ ⎦ ⎡ ⎤
1,3
0.885334
1 0 46495553 0 885334 R ⎡ ⎤ ⎢ ⎥ = ⎢ ⎥ ⎢ ⎥ ⎣ ⎦
0.46495553 0.885334 ⎢ ⎥ ⎣ ⎦
⎡ ⎤ 07182204 05847103 03771916 V V R = ⋅ = − − ⎡ ⎣ ⎢ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ ⎥
1 3
07182204 05847103 03771916 05176639 08112422 027186423 04649555 0885334
,
. . . . . .
60
⎣ ⎢ ⎦ ⎥ 04649555 0885334 . .
4.505028
0.0 20.32456
A ⎡ ⎤ ⎢ ⎥ = ⎢ ⎥
19.17042 ⎢ ⎥ ⎢ ⎥ ⎣ ⎦
⎡ ⎤
2,3
1 0.81445753 0.58022314 0 58022314 0 81445753 R ⎡ ⎤ ⎢ ⎥ = ⎢ ⎥ ⎢ ⎥ ⎣ ⎦
0.81445753 ⎢ ⎥ ⎣ ⎦
2 3
,
61
62
1 2 2
n n n n i j i j
−
, , 1 1, 1 1
i j i j i j j i i j i
= = ≠ = = +
k
63
, , q q p p
2
, , ,
q q p p p q
64
2 2 , ,
q q p p
,
p q
65
' 2 2 , , , , 2 2
p p p p p q q q
, , , 2 , , , ,
p p p q q q p p q q p p p q
2 2 2 , , ,
p p p q p q
, ,
p p p q
' , , , q q q q p q
2 2 , ,
q q p p
66
, , , q q q q p q
,
p q
'
'
, , , i p i p i q
, , , i q i p i q
1 tan( / 2) 1 1 S C C S C S τ θ τ − = = = ⇒ = − × +
1 C S +
'
A C a S a × ×
'
A S a C a = × + ×
, , , , ,
(1 )
i p i p i q i p i q
A C a S a S a S a S τ = × − × = − × − ×
, , , , ,
(1 )
i q i p i q i p i q
A S a C a S a S a S τ = × + × = × + − × ×
67
, , , i p i q i p
a S a a τ = − + ×
, , , i q i p i q
a S a a τ = + − ×
68
(1,2) (1,3) (1,4) (1, ) n
(2,4) (2, ) (3,4) (3, ) n n
( 1, ) n n −
69
DO NO change = TRUE
NO_change = .TRUE. DO p = 1, n-1 DO q = p+1, n IF (ABS( ( )) > T l) THEN
IF (ABS(a(p,q)) >= Tol) THEN NO_change = .FALASE. perform a (p,q)–rotation update eigenvectors END IF END DO END DO IF (NO_change) EXIT END DO
70
71
DO S 0
S = 0 DO p = 1, n-1 DO q = p+1, n
S = S + a(p,q)**2 END DO END DO
IF (2*S < Tol**2) EXIT perform a sweep without checking tolerance
checking tolerance END DO
1 2 , 1 1,
( )
n n i j i j j i
S A a ε
− = = ≠
= <
72
α γ ⎡ ⎤
1 2 2 2 3 3 3 4
α γ γ α γ γ α γ ⎡ ⎤ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
1 n n
α γ
− −
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
1 1 n n n n n
γ α γ γ α
− −
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎣ ⎦
⎡ ⎤ i i i i
⎡ ⎤ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ i i i i
i i i
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
i i
⎢ ⎥ ⎣ ⎦ i i
74
75
[1] J. Demmel and K. Veselić, Jacobi’s method is more accurate than QR, SIAM J. Matrix Anal. Appl., Vol. 13(1992), No. 4(Oct), pp. 1204-1245.
76