1CLAQR1(1) LAPACK auxiliary routine (version 3.2) CLAQR1(1)
2
3
4
7 SUBROUTINE CLAQR1( N, H, LDH, S1, S2, V )
8
9 COMPLEX S1, S2
10
11 INTEGER LDH, N
12
13 COMPLEX H( LDH, * ), V( * )
14
15 COMPLEX ZERO
16
17 PARAMETER ( ZERO = ( 0.0e0, 0.0e0 ) )
18
19 REAL RZERO
20
21 PARAMETER ( RZERO = 0.0e0 )
22
23 COMPLEX CDUM, H21S, H31S
24
25 REAL S
26
27 INTRINSIC ABS, AIMAG, REAL
28
29 REAL CABS1
30
31 CABS1( CDUM ) = ABS( REAL( CDUM ) ) + ABS( AIMAG( CDUM ) )
32
33 IF( N.EQ.2 ) THEN
34
35 S = CABS1( H( 1, 1 )-S2 ) + CABS1( H( 2, 1 ) )
36
37 IF( S.EQ.RZERO ) THEN
38
39 V( 1 ) = ZERO
40
41 V( 2 ) = ZERO
42
43 ELSE
44
45 H21S = H( 2, 1 ) / S
46
47 V( 1 ) = H21S*H( 1, 2 ) + ( H( 1, 1 )-S1 )* ( ( H( 1, 1
48 )-S2 ) / S )
49
50 V( 2 ) = H21S*( H( 1, 1 )+H( 2, 2 )-S1-S2 )
51
52 END IF
53
54 ELSE
55
56 S = CABS1( H( 1, 1 )-S2 ) + CABS1( H( 2, 1 ) ) +
57 CABS1( H( 3, 1 ) )
58
59 IF( S.EQ.ZERO ) THEN
60
61 V( 1 ) = ZERO
62
63 V( 2 ) = ZERO
64
65 V( 3 ) = ZERO
66
67 ELSE
68
69 H21S = H( 2, 1 ) / S
70
71 H31S = H( 3, 1 ) / S
72
73 V( 1 ) = ( H( 1, 1 )-S1 )*( ( H( 1, 1 )-S2 ) / S ) + H(
74 1, 2 )*H21S + H( 1, 3 )*H31S
75
76 V( 2 ) = H21S*( H( 1, 1 )+H( 2, 2 )-S1-S2 ) + H( 2, 3
77 )*H31S
78
79 V( 3 ) = H31S*( H( 1, 1 )+H( 3, 3 )-S1-S2 ) + H21S*H(
80 3, 2 )
81
82 END IF
83
84 END IF
85
86 END
87
89 LAPACK auxiliary routine (versionNo3v.e2m)ber 2008 CLAQR1(1)