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

◆ zswap()

subroutine zswap ( integer  n,
complex*16, dimension(*)  zx,
integer  incx,
complex*16, dimension(*)  zy,
integer  incy 
)

ZSWAP

Purpose:
    ZSWAP interchanges two vectors.
Parameters
[in]N
          N is INTEGER
         number of elements in input vector(s)
[in,out]ZX
          ZX is COMPLEX*16 array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
[in]INCX
          INCX is INTEGER
         storage spacing between elements of ZX
[in,out]ZY
          ZY is COMPLEX*16 array, dimension ( 1 + ( N - 1 )*abs( INCY ) )
[in]INCY
          INCY is INTEGER
         storage spacing between elements of ZY
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
     jack dongarra, 3/11/78.
     modified 12/3/93, array(1) declarations changed to array(*)

Definition at line 80 of file zswap.f.

81*
82* -- Reference BLAS level1 routine --
83* -- Reference BLAS is a software package provided by Univ. of Tennessee, --
84* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
85*
86* .. Scalar Arguments ..
87 INTEGER INCX,INCY,N
88* ..
89* .. Array Arguments ..
90 COMPLEX*16 ZX(*),ZY(*)
91* ..
92*
93* =====================================================================
94*
95* .. Local Scalars ..
96 COMPLEX*16 ZTEMP
97 INTEGER I,IX,IY
98* ..
99 IF (n.LE.0) RETURN
100 IF (incx.EQ.1 .AND. incy.EQ.1) THEN
101*
102* code for both increments equal to 1
103 DO i = 1,n
104 ztemp = zx(i)
105 zx(i) = zy(i)
106 zy(i) = ztemp
107 END DO
108 ELSE
109*
110* code for unequal increments or equal increments not equal
111* to 1
112*
113 ix = 1
114 iy = 1
115 IF (incx.LT.0) ix = (-n+1)*incx + 1
116 IF (incy.LT.0) iy = (-n+1)*incy + 1
117 DO i = 1,n
118 ztemp = zx(ix)
119 zx(ix) = zy(iy)
120 zy(iy) = ztemp
121 ix = ix + incx
122 iy = iy + incy
123 END DO
124 END IF
125 RETURN
126*
127* End of ZSWAP
128*