1 SUBROUTINE ZLAEV2
( A
, B
, C
, RT1
, RT2
, CS1
, SN1
)
3 * -- LAPACK auxiliary routine
(version
3.1) --
4 * Univ
. of Tennessee
, Univ
. of California Berkeley and NAG Ltd
..
7 * .. Scalar Arguments
..
8 DOUBLE PRECISION CS1
, RT1
, RT2
9 COMPLEX*16 A
, B
, C
, SN1
15 * ZLAEV2 computes the eigendecomposition of a
2-by
-2 Hermitian matrix
18 * On
return, RT1 is the eigenvalue of larger absolute value
, RT2 is the
19 * eigenvalue of smaller absolute value
, and
(CS1
,SN1
) is the unit right
20 * eigenvector
for RT1
, giving the decomposition
22 * [ CS1 CONJG
(SN1
) ] [ A B
] [ CS1
-CONJG
(SN1
) ] = [ RT1
0 ]
23 * [-SN1 CS1
] [ CONJG
(B
) C
] [ SN1 CS1
] [ 0 RT2
].
28 * A
(input
) COMPLEX*16
29 * The
(1,1) element of the
2-by
-2 matrix
.
31 * B
(input
) COMPLEX*16
32 * The
(1,2) element and the conjugate of the
(2,1) element of
35 * C
(input
) COMPLEX*16
36 * The
(2,2) element of the
2-by
-2 matrix
.
38 * RT1
(output
) DOUBLE PRECISION
39 * The eigenvalue of larger absolute value
.
41 * RT2
(output
) DOUBLE PRECISION
42 * The eigenvalue of smaller absolute value
.
44 * CS1
(output
) DOUBLE PRECISION
45 * SN1
(output
) COMPLEX*16
46 * The vector
(CS1
, SN1
) is a unit right eigenvector
for RT1
.
51 * RT1 is accurate
to a few ulps barring over
/underflow
.
53 * RT2 may be inaccurate
if there is massive cancellation in the
54 * determinant A*C
-B*B
; higher
precision or correctly rounded or
55 * correctly truncated arithmetic would be needed
to compute RT2
56 * accurately in all cases
.
58 * CS1 and SN1 are accurate
to a few ulps barring over
/underflow
.
60 * Overflow is possible only
if RT1 is within a factor of
5 of overflow
.
61 * Underflow is harmless
if the input data is
0 or exceeds
62 * underflow_threshold
/ macheps
.
64 * =====================================================================
68 PARAMETER ( ZERO
= 0.0D0
)
70 PARAMETER ( ONE
= 1.0D0
)
76 * .. External Subroutines
..
79 * .. Intrinsic Functions
..
80 INTRINSIC ABS
, DBLE
, DCONJG
82 * .. Executable Statements
..
84 IF( ABS
( B
).EQ
.ZERO
) THEN
87 W
= DCONJG
( B
) / ABS
( B
)
89 CALL DLAEV2
( DBLE
( A
), ABS
( B
), DBLE
( C
), RT1
, RT2
, CS1
, T
)