![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b CROT 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download CROT + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/crot.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/crot.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/crot.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE CROT( N, CX, INCX, CY, INCY, C, S ) 00022 * 00023 * .. Scalar Arguments .. 00024 * INTEGER INCX, INCY, N 00025 * REAL C 00026 * COMPLEX S 00027 * .. 00028 * .. Array Arguments .. 00029 * COMPLEX CX( * ), CY( * ) 00030 * .. 00031 * 00032 * 00033 *> \par Purpose: 00034 * ============= 00035 *> 00036 *> \verbatim 00037 *> 00038 *> CROT applies a plane rotation, where the cos (C) is real and the 00039 *> sin (S) is complex, and the vectors CX and CY are complex. 00040 *> \endverbatim 00041 * 00042 * Arguments: 00043 * ========== 00044 * 00045 *> \param[in] N 00046 *> \verbatim 00047 *> N is INTEGER 00048 *> The number of elements in the vectors CX and CY. 00049 *> \endverbatim 00050 *> 00051 *> \param[in,out] CX 00052 *> \verbatim 00053 *> CX is COMPLEX array, dimension (N) 00054 *> On input, the vector X. 00055 *> On output, CX is overwritten with C*X + S*Y. 00056 *> \endverbatim 00057 *> 00058 *> \param[in] INCX 00059 *> \verbatim 00060 *> INCX is INTEGER 00061 *> The increment between successive values of CY. INCX <> 0. 00062 *> \endverbatim 00063 *> 00064 *> \param[in,out] CY 00065 *> \verbatim 00066 *> CY is COMPLEX array, dimension (N) 00067 *> On input, the vector Y. 00068 *> On output, CY is overwritten with -CONJG(S)*X + C*Y. 00069 *> \endverbatim 00070 *> 00071 *> \param[in] INCY 00072 *> \verbatim 00073 *> INCY is INTEGER 00074 *> The increment between successive values of CY. INCX <> 0. 00075 *> \endverbatim 00076 *> 00077 *> \param[in] C 00078 *> \verbatim 00079 *> C is REAL 00080 *> \endverbatim 00081 *> 00082 *> \param[in] S 00083 *> \verbatim 00084 *> S is COMPLEX 00085 *> C and S define a rotation 00086 *> [ C S ] 00087 *> [ -conjg(S) C ] 00088 *> where C*C + S*CONJG(S) = 1.0. 00089 *> \endverbatim 00090 * 00091 * Authors: 00092 * ======== 00093 * 00094 *> \author Univ. of Tennessee 00095 *> \author Univ. of California Berkeley 00096 *> \author Univ. of Colorado Denver 00097 *> \author NAG Ltd. 00098 * 00099 *> \date November 2011 00100 * 00101 *> \ingroup complexOTHERauxiliary 00102 * 00103 * ===================================================================== 00104 SUBROUTINE CROT( N, CX, INCX, CY, INCY, C, S ) 00105 * 00106 * -- LAPACK auxiliary routine (version 3.4.0) -- 00107 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00108 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00109 * November 2011 00110 * 00111 * .. Scalar Arguments .. 00112 INTEGER INCX, INCY, N 00113 REAL C 00114 COMPLEX S 00115 * .. 00116 * .. Array Arguments .. 00117 COMPLEX CX( * ), CY( * ) 00118 * .. 00119 * 00120 * ===================================================================== 00121 * 00122 * .. Local Scalars .. 00123 INTEGER I, IX, IY 00124 COMPLEX STEMP 00125 * .. 00126 * .. Intrinsic Functions .. 00127 INTRINSIC CONJG 00128 * .. 00129 * .. Executable Statements .. 00130 * 00131 IF( N.LE.0 ) 00132 $ RETURN 00133 IF( INCX.EQ.1 .AND. INCY.EQ.1 ) 00134 $ GO TO 20 00135 * 00136 * Code for unequal increments or equal increments not equal to 1 00137 * 00138 IX = 1 00139 IY = 1 00140 IF( INCX.LT.0 ) 00141 $ IX = ( -N+1 )*INCX + 1 00142 IF( INCY.LT.0 ) 00143 $ IY = ( -N+1 )*INCY + 1 00144 DO 10 I = 1, N 00145 STEMP = C*CX( IX ) + S*CY( IY ) 00146 CY( IY ) = C*CY( IY ) - CONJG( S )*CX( IX ) 00147 CX( IX ) = STEMP 00148 IX = IX + INCX 00149 IY = IY + INCY 00150 10 CONTINUE 00151 RETURN 00152 * 00153 * Code for both increments equal to 1 00154 * 00155 20 CONTINUE 00156 DO 30 I = 1, N 00157 STEMP = C*CX( I ) + S*CY( I ) 00158 CY( I ) = C*CY( I ) - CONJG( S )*CX( I ) 00159 CX( I ) = STEMP 00160 30 CONTINUE 00161 RETURN 00162 END