![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b CLAEV2 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download CLAEV2 + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/claev2.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/claev2.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/claev2.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE CLAEV2( A, B, C, RT1, RT2, CS1, SN1 ) 00022 * 00023 * .. Scalar Arguments .. 00024 * REAL CS1, RT1, RT2 00025 * COMPLEX A, B, C, SN1 00026 * .. 00027 * 00028 * 00029 *> \par Purpose: 00030 * ============= 00031 *> 00032 *> \verbatim 00033 *> 00034 *> CLAEV2 computes the eigendecomposition of a 2-by-2 Hermitian matrix 00035 *> [ A B ] 00036 *> [ CONJG(B) C ]. 00037 *> On return, RT1 is the eigenvalue of larger absolute value, RT2 is the 00038 *> eigenvalue of smaller absolute value, and (CS1,SN1) is the unit right 00039 *> eigenvector for RT1, giving the decomposition 00040 *> 00041 *> [ CS1 CONJG(SN1) ] [ A B ] [ CS1 -CONJG(SN1) ] = [ RT1 0 ] 00042 *> [-SN1 CS1 ] [ CONJG(B) C ] [ SN1 CS1 ] [ 0 RT2 ]. 00043 *> \endverbatim 00044 * 00045 * Arguments: 00046 * ========== 00047 * 00048 *> \param[in] A 00049 *> \verbatim 00050 *> A is COMPLEX 00051 *> The (1,1) element of the 2-by-2 matrix. 00052 *> \endverbatim 00053 *> 00054 *> \param[in] B 00055 *> \verbatim 00056 *> B is COMPLEX 00057 *> The (1,2) element and the conjugate of the (2,1) element of 00058 *> the 2-by-2 matrix. 00059 *> \endverbatim 00060 *> 00061 *> \param[in] C 00062 *> \verbatim 00063 *> C is COMPLEX 00064 *> The (2,2) element of the 2-by-2 matrix. 00065 *> \endverbatim 00066 *> 00067 *> \param[out] RT1 00068 *> \verbatim 00069 *> RT1 is REAL 00070 *> The eigenvalue of larger absolute value. 00071 *> \endverbatim 00072 *> 00073 *> \param[out] RT2 00074 *> \verbatim 00075 *> RT2 is REAL 00076 *> The eigenvalue of smaller absolute value. 00077 *> \endverbatim 00078 *> 00079 *> \param[out] CS1 00080 *> \verbatim 00081 *> CS1 is REAL 00082 *> \endverbatim 00083 *> 00084 *> \param[out] SN1 00085 *> \verbatim 00086 *> SN1 is COMPLEX 00087 *> The vector (CS1, SN1) is a unit right eigenvector for RT1. 00088 *> \endverbatim 00089 * 00090 * Authors: 00091 * ======== 00092 * 00093 *> \author Univ. of Tennessee 00094 *> \author Univ. of California Berkeley 00095 *> \author Univ. of Colorado Denver 00096 *> \author NAG Ltd. 00097 * 00098 *> \date November 2011 00099 * 00100 *> \ingroup complexOTHERauxiliary 00101 * 00102 *> \par Further Details: 00103 * ===================== 00104 *> 00105 *> \verbatim 00106 *> 00107 *> RT1 is accurate to a few ulps barring over/underflow. 00108 *> 00109 *> RT2 may be inaccurate if there is massive cancellation in the 00110 *> determinant A*C-B*B; higher precision or correctly rounded or 00111 *> correctly truncated arithmetic would be needed to compute RT2 00112 *> accurately in all cases. 00113 *> 00114 *> CS1 and SN1 are accurate to a few ulps barring over/underflow. 00115 *> 00116 *> Overflow is possible only if RT1 is within a factor of 5 of overflow. 00117 *> Underflow is harmless if the input data is 0 or exceeds 00118 *> underflow_threshold / macheps. 00119 *> \endverbatim 00120 *> 00121 * ===================================================================== 00122 SUBROUTINE CLAEV2( A, B, C, RT1, RT2, CS1, SN1 ) 00123 * 00124 * -- LAPACK auxiliary routine (version 3.4.0) -- 00125 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00126 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00127 * November 2011 00128 * 00129 * .. Scalar Arguments .. 00130 REAL CS1, RT1, RT2 00131 COMPLEX A, B, C, SN1 00132 * .. 00133 * 00134 * ===================================================================== 00135 * 00136 * .. Parameters .. 00137 REAL ZERO 00138 PARAMETER ( ZERO = 0.0E0 ) 00139 REAL ONE 00140 PARAMETER ( ONE = 1.0E0 ) 00141 * .. 00142 * .. Local Scalars .. 00143 REAL T 00144 COMPLEX W 00145 * .. 00146 * .. External Subroutines .. 00147 EXTERNAL SLAEV2 00148 * .. 00149 * .. Intrinsic Functions .. 00150 INTRINSIC ABS, CONJG, REAL 00151 * .. 00152 * .. Executable Statements .. 00153 * 00154 IF( ABS( B ).EQ.ZERO ) THEN 00155 W = ONE 00156 ELSE 00157 W = CONJG( B ) / ABS( B ) 00158 END IF 00159 CALL SLAEV2( REAL( A ), ABS( B ), REAL( C ), RT1, RT2, CS1, T ) 00160 SN1 = W*T 00161 RETURN 00162 * 00163 * End of CLAEV2 00164 * 00165 END