LAPACK 3.3.0

claev2.f

Go to the documentation of this file.
00001       SUBROUTINE CLAEV2( A, B, C, RT1, RT2, CS1, SN1 )
00002 *
00003 *  -- LAPACK auxiliary routine (version 3.2) --
00004 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00005 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00006 *     November 2006
00007 *
00008 *     .. Scalar Arguments ..
00009       REAL               CS1, RT1, RT2
00010       COMPLEX            A, B, C, SN1
00011 *     ..
00012 *
00013 *  Purpose
00014 *  =======
00015 *
00016 *  CLAEV2 computes the eigendecomposition of a 2-by-2 Hermitian matrix
00017 *     [  A         B  ]
00018 *     [  CONJG(B)  C  ].
00019 *  On return, RT1 is the eigenvalue of larger absolute value, RT2 is the
00020 *  eigenvalue of smaller absolute value, and (CS1,SN1) is the unit right
00021 *  eigenvector for RT1, giving the decomposition
00022 *
00023 *  [ CS1  CONJG(SN1) ] [    A     B ] [ CS1 -CONJG(SN1) ] = [ RT1  0  ]
00024 *  [-SN1     CS1     ] [ CONJG(B) C ] [ SN1     CS1     ]   [  0  RT2 ].
00025 *
00026 *  Arguments
00027 *  =========
00028 *
00029 *  A      (input) COMPLEX
00030 *         The (1,1) element of the 2-by-2 matrix.
00031 *
00032 *  B      (input) COMPLEX
00033 *         The (1,2) element and the conjugate of the (2,1) element of
00034 *         the 2-by-2 matrix.
00035 *
00036 *  C      (input) COMPLEX
00037 *         The (2,2) element of the 2-by-2 matrix.
00038 *
00039 *  RT1    (output) REAL
00040 *         The eigenvalue of larger absolute value.
00041 *
00042 *  RT2    (output) REAL
00043 *         The eigenvalue of smaller absolute value.
00044 *
00045 *  CS1    (output) REAL
00046 *  SN1    (output) COMPLEX
00047 *         The vector (CS1, SN1) is a unit right eigenvector for RT1.
00048 *
00049 *  Further Details
00050 *  ===============
00051 *
00052 *  RT1 is accurate to a few ulps barring over/underflow.
00053 *
00054 *  RT2 may be inaccurate if there is massive cancellation in the
00055 *  determinant A*C-B*B; higher precision or correctly rounded or
00056 *  correctly truncated arithmetic would be needed to compute RT2
00057 *  accurately in all cases.
00058 *
00059 *  CS1 and SN1 are accurate to a few ulps barring over/underflow.
00060 *
00061 *  Overflow is possible only if RT1 is within a factor of 5 of overflow.
00062 *  Underflow is harmless if the input data is 0 or exceeds
00063 *     underflow_threshold / macheps.
00064 *
00065 * =====================================================================
00066 *
00067 *     .. Parameters ..
00068       REAL               ZERO
00069       PARAMETER          ( ZERO = 0.0E0 )
00070       REAL               ONE
00071       PARAMETER          ( ONE = 1.0E0 )
00072 *     ..
00073 *     .. Local Scalars ..
00074       REAL               T
00075       COMPLEX            W
00076 *     ..
00077 *     .. External Subroutines ..
00078       EXTERNAL           SLAEV2
00079 *     ..
00080 *     .. Intrinsic Functions ..
00081       INTRINSIC          ABS, CONJG, REAL
00082 *     ..
00083 *     .. Executable Statements ..
00084 *
00085       IF( ABS( B ).EQ.ZERO ) THEN
00086          W = ONE
00087       ELSE
00088          W = CONJG( B ) / ABS( B )
00089       END IF
00090       CALL SLAEV2( REAL( A ), ABS( B ), REAL( C ), RT1, RT2, CS1, T )
00091       SN1 = W*T
00092       RETURN
00093 *
00094 *     End of CLAEV2
00095 *
00096       END
 All Files Functions