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