Debian Codegraph @

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

raw
1 /* ./src_f77/dcopy.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 dcopy_(integer *n, doublereal *dx, integer *incx,
9 doublereal *dy, integer *incy)
10 {
11 /* System generated locals */
12 integer i__1;
13
14 /* Local variables */
15 static integer i__, m, ix, iy, mp1;
16
17
18 /* copies a vector, x, to a vector, y. */
19 /* uses unrolled loops for increments equal to one. */
20 /* jack dongarra, linpack, 3/11/78. */
21 /* modified 12/3/93, array(1) declarations changed to array(*) */
22
23
24 /* Parameter adjustments */
25 --dy;
26 --dx;
27
28 /* Function Body */
29 if (*n <= 0) {
30 return 0;
31 }
32 if (*incx == 1 && *incy == 1) {
33 goto L20;
34 }
35
36 /* code for unequal increments or equal increments */
37 /* not equal to 1 */
38
39 ix = 1;
40 iy = 1;
41 if (*incx < 0) {
42 ix = (-(*n) + 1) * *incx + 1;
43 }
44 if (*incy < 0) {
45 iy = (-(*n) + 1) * *incy + 1;
46 }
47 i__1 = *n;
48 for (i__ = 1; i__ <= i__1; ++i__) {
49 dy[iy] = dx[ix];
50 ix += *incx;
51 iy += *incy;
52 /* L10: */
53 }
54 return 0;
55
56 /* code for both increments equal to 1 */
57
58
59 /* clean-up loop */
60
61 L20:
62 m = *n % 7;
63 if (m == 0) {
64 goto L40;
65 }
66 i__1 = m;
67 for (i__ = 1; i__ <= i__1; ++i__) {
68 dy[i__] = dx[i__];
69 /* L30: */
70 }
71 if (*n < 7) {
72 return 0;
73 }
74 L40:
75 mp1 = m + 1;
76 i__1 = *n;
77 for (i__ = mp1; i__ <= i__1; i__ += 7) {
78 dy[i__] = dx[i__];
79 dy[i__ + 1] = dx[i__ + 1];
80 dy[i__ + 2] = dx[i__ + 2];
81 dy[i__ + 3] = dx[i__ + 3];
82 dy[i__ + 4] = dx[i__ + 4];
83 dy[i__ + 5] = dx[i__ + 5];
84 dy[i__ + 6] = dx[i__ + 6];
85 /* L50: */
86 }
87 return 0;
88 } /* dcopy_ */
89