Subroutine */
| 19153 | } /* zscal_ */ |
| 19154 | |
| 19155 | /* Subroutine */ int zswap_(integer *n, doublecomplex *zx, integer *incx, |
| 19156 | doublecomplex *zy, integer *incy) |
| 19157 | { |
| 19158 | /* System generated locals */ |
| 19159 | integer i__1, i__2, i__3; |
| 19160 | |
| 19161 | /* Local variables */ |
| 19162 | static integer i__, ix, iy; |
| 19163 | static doublecomplex ztemp; |
| 19164 | |
| 19165 | |
| 19166 | /* |
| 19167 | Purpose |
| 19168 | ======= |
| 19169 | |
| 19170 | ZSWAP interchanges two vectors. |
| 19171 | |
| 19172 | Further Details |
| 19173 | =============== |
| 19174 | |
| 19175 | jack dongarra, 3/11/78. |
| 19176 | modified 12/3/93, array(1) declarations changed to array(*) |
| 19177 | |
| 19178 | ===================================================================== |
| 19179 | */ |
| 19180 | |
| 19181 | /* Parameter adjustments */ |
| 19182 | --zy; |
| 19183 | --zx; |
| 19184 | |
| 19185 | /* Function Body */ |
| 19186 | if (*n <= 0) { |
| 19187 | return 0; |
| 19188 | } |
| 19189 | if (*incx == 1 && *incy == 1) { |
| 19190 | goto L20; |
| 19191 | } |
| 19192 | |
| 19193 | /* |
| 19194 | code for unequal increments or equal increments not equal |
| 19195 | to 1 |
| 19196 | */ |
| 19197 | |
| 19198 | ix = 1; |
| 19199 | iy = 1; |
| 19200 | if (*incx < 0) { |
| 19201 | ix = (-(*n) + 1) * *incx + 1; |
| 19202 | } |
| 19203 | if (*incy < 0) { |
| 19204 | iy = (-(*n) + 1) * *incy + 1; |
| 19205 | } |
| 19206 | i__1 = *n; |
| 19207 | for (i__ = 1; i__ <= i__1; ++i__) { |
| 19208 | i__2 = ix; |
| 19209 | ztemp.r = zx[i__2].r, ztemp.i = zx[i__2].i; |
| 19210 | i__2 = ix; |
| 19211 | i__3 = iy; |
| 19212 | zx[i__2].r = zy[i__3].r, zx[i__2].i = zy[i__3].i; |