Debian Codegraph @

debian/external_deps/fetk/punc/src/blas/zcopy.c

raw
1 /* ./src_f77/zcopy.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 zcopy_(integer *n, doublecomplex *zx, integer *incx,
9 doublecomplex *zy, 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, 4/11/78. */
20 /* modified 12/3/93, array(1) declarations changed to array(*) */
21
22
23 /* Parameter adjustments */
24 --zy;
25 --zx;
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 zy[i__2].r = zx[i__3].r, zy[i__2].i = zx[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 zy[i__2].r = zx[i__3].r, zy[i__2].i = zx[i__3].i;
65 /* L30: */
66 }
67 return 0;
68 } /* zcopy_ */
69