LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
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.

Download ZROT + dependencies [TGZ] [ZIP] [TXT]

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.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 100 of file zrot.f.

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