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

◆ zdrot()

subroutine zdrot ( integer  n,
complex*16, dimension( * )  zx,
integer  incx,
complex*16, dimension( * )  zy,
integer  incy,
double precision  c,
double precision  s 
)

ZDROT

Purpose:
 Applies a plane rotation, where the cos and sin (c and s) are real
 and the vectors cx and cy are complex.
 jack dongarra, linpack, 3/11/78.
Parameters
[in]N
          N is INTEGER
           On entry, N specifies the order of the vectors cx and cy.
           N must be at least zero.
[in,out]ZX
          ZX is COMPLEX*16 array, dimension at least
           ( 1 + ( N - 1 )*abs( INCX ) ).
           Before entry, the incremented array ZX must contain the n
           element vector cx. On exit, ZX is overwritten by the updated
           vector cx.
[in]INCX
          INCX is INTEGER
           On entry, INCX specifies the increment for the elements of
           ZX. INCX must not be zero.
[in,out]ZY
          ZY is COMPLEX*16 array, dimension at least
           ( 1 + ( N - 1 )*abs( INCY ) ).
           Before entry, the incremented array ZY must contain the n
           element vector cy. On exit, ZY is overwritten by the updated
           vector cy.
[in]INCY
          INCY is INTEGER
           On entry, INCY specifies the increment for the elements of
           ZY. INCY must not be zero.
[in]C
          C is DOUBLE PRECISION
           On entry, C specifies the cosine, cos.
[in]S
          S is DOUBLE PRECISION
           On entry, S specifies the sine, sin.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 97 of file zdrot.f.

98*
99* -- Reference BLAS level1 routine --
100* -- Reference BLAS is a software package provided by Univ. of Tennessee, --
101* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
102*
103* .. Scalar Arguments ..
104 INTEGER INCX, INCY, N
105 DOUBLE PRECISION C, S
106* ..
107* .. Array Arguments ..
108 COMPLEX*16 ZX( * ), ZY( * )
109* ..
110*
111* =====================================================================
112*
113* .. Local Scalars ..
114 INTEGER I, IX, IY
115 COMPLEX*16 CTEMP
116* ..
117* .. Executable Statements ..
118*
119 IF( n.LE.0 )
120 $ RETURN
121 IF( incx.EQ.1 .AND. incy.EQ.1 ) THEN
122*
123* code for both increments equal to 1
124*
125 DO i = 1, n
126 ctemp = c*zx( i ) + s*zy( i )
127 zy( i ) = c*zy( i ) - s*zx( i )
128 zx( i ) = ctemp
129 END DO
130 ELSE
131*
132* code for unequal increments or equal increments not equal
133* 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 i = 1, n
142 ctemp = c*zx( ix ) + s*zy( iy )
143 zy( iy ) = c*zy( iy ) - s*zx( ix )
144 zx( ix ) = ctemp
145 ix = ix + incx
146 iy = iy + incy
147 END DO
148 END IF
149 RETURN
150*
151* End of ZDROT
152*
Here is the caller graph for this function: