![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b CLAR2V 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download CLAR2V + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/clar2v.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/clar2v.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clar2v.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE CLAR2V( N, X, Y, Z, INCX, C, S, INCC ) 00022 * 00023 * .. Scalar Arguments .. 00024 * INTEGER INCC, INCX, N 00025 * .. 00026 * .. Array Arguments .. 00027 * REAL C( * ) 00028 * COMPLEX S( * ), X( * ), Y( * ), Z( * ) 00029 * .. 00030 * 00031 * 00032 *> \par Purpose: 00033 * ============= 00034 *> 00035 *> \verbatim 00036 *> 00037 *> CLAR2V applies a vector of complex plane rotations with real cosines 00038 *> from both sides to a sequence of 2-by-2 complex Hermitian matrices, 00039 *> defined by the elements of the vectors x, y and z. For i = 1,2,...,n 00040 *> 00041 *> ( x(i) z(i) ) := 00042 *> ( conjg(z(i)) y(i) ) 00043 *> 00044 *> ( c(i) conjg(s(i)) ) ( x(i) z(i) ) ( c(i) -conjg(s(i)) ) 00045 *> ( -s(i) c(i) ) ( conjg(z(i)) y(i) ) ( s(i) c(i) ) 00046 *> \endverbatim 00047 * 00048 * Arguments: 00049 * ========== 00050 * 00051 *> \param[in] N 00052 *> \verbatim 00053 *> N is INTEGER 00054 *> The number of plane rotations to be applied. 00055 *> \endverbatim 00056 *> 00057 *> \param[in,out] X 00058 *> \verbatim 00059 *> X is COMPLEX array, dimension (1+(N-1)*INCX) 00060 *> The vector x; the elements of x are assumed to be real. 00061 *> \endverbatim 00062 *> 00063 *> \param[in,out] Y 00064 *> \verbatim 00065 *> Y is COMPLEX array, dimension (1+(N-1)*INCX) 00066 *> The vector y; the elements of y are assumed to be real. 00067 *> \endverbatim 00068 *> 00069 *> \param[in,out] Z 00070 *> \verbatim 00071 *> Z is COMPLEX array, dimension (1+(N-1)*INCX) 00072 *> The vector z. 00073 *> \endverbatim 00074 *> 00075 *> \param[in] INCX 00076 *> \verbatim 00077 *> INCX is INTEGER 00078 *> The increment between elements of X, Y and Z. INCX > 0. 00079 *> \endverbatim 00080 *> 00081 *> \param[in] C 00082 *> \verbatim 00083 *> C is REAL array, dimension (1+(N-1)*INCC) 00084 *> The cosines of the plane rotations. 00085 *> \endverbatim 00086 *> 00087 *> \param[in] S 00088 *> \verbatim 00089 *> S is COMPLEX array, dimension (1+(N-1)*INCC) 00090 *> The sines of the plane rotations. 00091 *> \endverbatim 00092 *> 00093 *> \param[in] INCC 00094 *> \verbatim 00095 *> INCC is INTEGER 00096 *> The increment between elements of C and S. INCC > 0. 00097 *> \endverbatim 00098 * 00099 * Authors: 00100 * ======== 00101 * 00102 *> \author Univ. of Tennessee 00103 *> \author Univ. of California Berkeley 00104 *> \author Univ. of Colorado Denver 00105 *> \author NAG Ltd. 00106 * 00107 *> \date November 2011 00108 * 00109 *> \ingroup complexOTHERauxiliary 00110 * 00111 * ===================================================================== 00112 SUBROUTINE CLAR2V( N, X, Y, Z, INCX, C, S, INCC ) 00113 * 00114 * -- LAPACK auxiliary routine (version 3.4.0) -- 00115 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00116 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00117 * November 2011 00118 * 00119 * .. Scalar Arguments .. 00120 INTEGER INCC, INCX, N 00121 * .. 00122 * .. Array Arguments .. 00123 REAL C( * ) 00124 COMPLEX S( * ), X( * ), Y( * ), Z( * ) 00125 * .. 00126 * 00127 * ===================================================================== 00128 * 00129 * .. Local Scalars .. 00130 INTEGER I, IC, IX 00131 REAL CI, SII, SIR, T1I, T1R, T5, T6, XI, YI, ZII, 00132 $ ZIR 00133 COMPLEX SI, T2, T3, T4, ZI 00134 * .. 00135 * .. Intrinsic Functions .. 00136 INTRINSIC AIMAG, CMPLX, CONJG, REAL 00137 * .. 00138 * .. Executable Statements .. 00139 * 00140 IX = 1 00141 IC = 1 00142 DO 10 I = 1, N 00143 XI = REAL( X( IX ) ) 00144 YI = REAL( Y( IX ) ) 00145 ZI = Z( IX ) 00146 ZIR = REAL( ZI ) 00147 ZII = AIMAG( ZI ) 00148 CI = C( IC ) 00149 SI = S( IC ) 00150 SIR = REAL( SI ) 00151 SII = AIMAG( SI ) 00152 T1R = SIR*ZIR - SII*ZII 00153 T1I = SIR*ZII + SII*ZIR 00154 T2 = CI*ZI 00155 T3 = T2 - CONJG( SI )*XI 00156 T4 = CONJG( T2 ) + SI*YI 00157 T5 = CI*XI + T1R 00158 T6 = CI*YI - T1R 00159 X( IX ) = CI*T5 + ( SIR*REAL( T4 )+SII*AIMAG( T4 ) ) 00160 Y( IX ) = CI*T6 - ( SIR*REAL( T3 )-SII*AIMAG( T3 ) ) 00161 Z( IX ) = CI*T3 + CONJG( SI )*CMPLX( T6, T1I ) 00162 IX = IX + INCX 00163 IC = IC + INCC 00164 10 CONTINUE 00165 RETURN 00166 * 00167 * End of CLAR2V 00168 * 00169 END