| 1 |
/* ./src_f77/ccopy.f -- translated by f2c (version 20030320). |
| 2 |
You must link the resulting object file with the libraries: |
| 3 |
-lf2c -lm (in that order) |
| 4 |
*/ |
| 5 |
|
| 6 |
#include <punc/vf2c.h> |
| 7 |
|
| 8 |
/* Subroutine */ int ccopy_(integer *n, realcomplex *cx, integer *incx, realcomplex * |
| 9 |
cy, integer *incy) |
| 10 |
{ |
| 11 |
/* System generated locals */ |
| 12 |
integer i__1, i__2, i__3; |
| 13 |
|
| 14 |
/* Local variables */ |
| 15 |
static integer i__, ix, iy; |
| 16 |
|
| 17 |
|
| 18 |
/* copies a vector, x, to a vector, y. */ |
| 19 |
/* jack dongarra, linpack, 3/11/78. */ |
| 20 |
/* modified 12/3/93, array(1) declarations changed to array(*) */ |
| 21 |
|
| 22 |
|
| 23 |
/* Parameter adjustments */ |
| 24 |
--cy; |
| 25 |
--cx; |
| 26 |
|
| 27 |
/* Function Body */ |
| 28 |
if (*n <= 0) { |
| 29 |
return 0; |
| 30 |
} |
| 31 |
if (*incx == 1 && *incy == 1) { |
| 32 |
goto L20; |
| 33 |
} |
| 34 |
|
| 35 |
/* code for unequal increments or equal increments */ |
| 36 |
/* not equal to 1 */ |
| 37 |
|
| 38 |
ix = 1; |
| 39 |
iy = 1; |
| 40 |
if (*incx < 0) { |
| 41 |
ix = (-(*n) + 1) * *incx + 1; |
| 42 |
} |
| 43 |
if (*incy < 0) { |
| 44 |
iy = (-(*n) + 1) * *incy + 1; |
| 45 |
} |
| 46 |
i__1 = *n; |
| 47 |
for (i__ = 1; i__ <= i__1; ++i__) { |
| 48 |
i__2 = iy; |
| 49 |
i__3 = ix; |
| 50 |
cy[i__2].r = cx[i__3].r, cy[i__2].i = cx[i__3].i; |
| 51 |
ix += *incx; |
| 52 |
iy += *incy; |
| 53 |
/* L10: */ |
| 54 |
} |
| 55 |
return 0; |
| 56 |
|
| 57 |
/* code for both increments equal to 1 */ |
| 58 |
|
| 59 |
L20: |
| 60 |
i__1 = *n; |
| 61 |
for (i__ = 1; i__ <= i__1; ++i__) { |
| 62 |
i__2 = i__; |
| 63 |
i__3 = i__; |
| 64 |
cy[i__2].r = cx[i__3].r, cy[i__2].i = cx[i__3].i; |
| 65 |
/* L30: */ |
| 66 |
} |
| 67 |
return 0; |
| 68 |
} /* ccopy_ */ |
| 69 |
|