LAPACK 3.12.0 LAPACK: Linear Algebra PACKage
Searching...
No Matches

## ◆ zrot()

 subroutine zrot ( integer n, complex*16, dimension( * ) cx, integer incx, complex*16, dimension( * ) cy, integer incy, double precision c, complex*16 s )

ZROT applies a plane rotation with real cosine and complex sine to a pair of complex vectors.

Purpose:
ZROT applies a plane rotation, where the cos (C) is real and the
sin (S) is complex, and the vectors CX and CY are complex.
Parameters
 [in] N N is INTEGER The number of elements in the vectors CX and CY. [in,out] CX CX is COMPLEX*16 array, dimension (N) On input, the vector X. On output, CX is overwritten with C*X + S*Y. [in] INCX INCX is INTEGER The increment between successive values of CX. INCX <> 0. [in,out] CY CY is COMPLEX*16 array, dimension (N) On input, the vector Y. On output, CY is overwritten with -CONJG(S)*X + C*Y. [in] INCY INCY is INTEGER The increment between successive values of CY. INCX <> 0. [in] C C is DOUBLE PRECISION [in] S S is COMPLEX*16 C and S define a rotation [ C S ] [ -conjg(S) C ] where C*C + S*CONJG(S) = 1.0.

Definition at line 102 of file zrot.f.

103*
104* -- LAPACK auxiliary routine --
105* -- LAPACK is a software package provided by Univ. of Tennessee, --
106* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
107*
108* .. Scalar Arguments ..
109 INTEGER INCX, INCY, N
110 DOUBLE PRECISION C
111 COMPLEX*16 S
112* ..
113* .. Array Arguments ..
114 COMPLEX*16 CX( * ), CY( * )
115* ..
116*
117* =====================================================================
118*
119* .. Local Scalars ..
120 INTEGER I, IX, IY
121 COMPLEX*16 STEMP
122* ..
123* .. Intrinsic Functions ..
124 INTRINSIC dconjg
125* ..
126* .. Executable Statements ..
127*
128 IF( n.LE.0 )
129 \$ RETURN
130 IF( incx.EQ.1 .AND. incy.EQ.1 )
131 \$ GO TO 20
132*
133* Code for unequal increments or equal increments not equal to 1
134*
135 ix = 1
136 iy = 1
137 IF( incx.LT.0 )
138 \$ ix = ( -n+1 )*incx + 1
139 IF( incy.LT.0 )
140 \$ iy = ( -n+1 )*incy + 1
141 DO 10 i = 1, n
142 stemp = c*cx( ix ) + s*cy( iy )
143 cy( iy ) = c*cy( iy ) - dconjg( s )*cx( ix )
144 cx( ix ) = stemp
145 ix = ix + incx
146 iy = iy + incy
147 10 CONTINUE
148 RETURN
149*
150* Code for both increments equal to 1
151*
152 20 CONTINUE
153 DO 30 i = 1, n
154 stemp = c*cx( i ) + s*cy( i )
155 cy( i ) = c*cy( i ) - dconjg( s )*cx( i )
156 cx( i ) = stemp
157 30 CONTINUE
158 RETURN
Here is the caller graph for this function: