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