LAPACK 3.3.0

zlaev2.f

Go to the documentation of this file.
00001       SUBROUTINE ZLAEV2( 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       DOUBLE PRECISION   CS1, RT1, RT2
00010       COMPLEX*16         A, B, C, SN1
00011 *     ..
00012 *
00013 *  Purpose
00014 *  =======
00015 *
00016 *  ZLAEV2 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*16
00030 *         The (1,1) element of the 2-by-2 matrix.
00031 *
00032 *  B      (input) COMPLEX*16
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*16
00037 *         The (2,2) element of the 2-by-2 matrix.
00038 *
00039 *  RT1    (output) DOUBLE PRECISION
00040 *         The eigenvalue of larger absolute value.
00041 *
00042 *  RT2    (output) DOUBLE PRECISION
00043 *         The eigenvalue of smaller absolute value.
00044 *
00045 *  CS1    (output) DOUBLE PRECISION
00046 *  SN1    (output) COMPLEX*16
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       DOUBLE PRECISION   ZERO
00069       PARAMETER          ( ZERO = 0.0D0 )
00070       DOUBLE PRECISION   ONE
00071       PARAMETER          ( ONE = 1.0D0 )
00072 *     ..
00073 *     .. Local Scalars ..
00074       DOUBLE PRECISION   T
00075       COMPLEX*16         W
00076 *     ..
00077 *     .. External Subroutines ..
00078       EXTERNAL           DLAEV2
00079 *     ..
00080 *     .. Intrinsic Functions ..
00081       INTRINSIC          ABS, DBLE, DCONJG
00082 *     ..
00083 *     .. Executable Statements ..
00084 *
00085       IF( ABS( B ).EQ.ZERO ) THEN
00086          W = ONE
00087       ELSE
00088          W = DCONJG( B ) / ABS( B )
00089       END IF
00090       CALL DLAEV2( DBLE( A ), ABS( B ), DBLE( C ), RT1, RT2, CS1, T )
00091       SN1 = W*T
00092       RETURN
00093 *
00094 *     End of ZLAEV2
00095 *
00096       END
 All Files Functions