2 SUBROUTINE DCOPY
(N
, DX
, INCX
, DY
, INCY
)
3 C***BEGIN PROLOGUE DCOPY
4 C***PURPOSE Copy a vector.
6 C***TYPE DOUBLE PRECISION (SCOPY-S, DCOPY-D, CCOPY-C, ICOPY-I)
7 C***KEYWORDS BLAS, COPY, LINEAR ALGEBRA, VECTOR
8 C***AUTHOR Lawson, C. L., (JPL)
9 C Hanson, R. J., (SNLA)
10 C Kincaid, D. R., (U. of Texas)
15 C Description of Parameters
18 C N number of elements in input vector(s)
19 C DX double precision vector with N elements
20 C INCX storage spacing between elements of DX
21 C DY double precision vector with N elements
22 C INCY storage spacing between elements of DY
25 C DY copy of vector DX (unchanged if N .LE. 0)
27 C Copy double precision DX to double precision DY.
28 C For I = 0 to N-1, copy DX(LX+I*INCX) to DY(LY+I*INCY),
29 C where LX = 1 if INCX .GE. 0, else LX = 1+(1-N)*INCX, and LY is
30 C defined in a similar way using INCY.
32 C***REFERENCES C. L. Lawson, R. J. Hanson, D. R. Kincaid and F. T.
33 C Krogh, Basic linear algebra subprograms for Fortran
34 C usage, Algorithm No. 539, Transactions on Mathematical
35 C Software 5, 3 (September 1979), pp. 308-323.
36 C***ROUTINES CALLED (NONE)
37 C***REVISION HISTORY (YYMMDD)
39 C 890831 Modified array declarations. (WRB)
40 C 890831 REVISION DATE from Version 3.2
41 C 891214 Prologue converted to Version 4.0 format. (BAB)
42 C 920310 Corrected definition of LX in DESCRIPTION. (WRB)
43 C 920501 Reformatted the REFERENCES section. (WRB)
44 C***END PROLOGUE DCOPY
45 DOUBLE PRECISION DX
(*), DY
(*)
46 C***FIRST EXECUTABLE STATEMENT DCOPY
48 IF (INCX
.EQ
. INCY
) IF (INCX
-1) 5,20,60
50 C Code for unequal or nonpositive increments.
54 IF (INCX
.LT
. 0) IX
= (-N
+1)*INCX
+ 1
55 IF (INCY
.LT
. 0) IY
= (-N
+1)*INCY
+ 1
63 C Code for both increments equal to 1.
65 C Clean-up loop so remaining vector length is a multiple of 7.
68 IF (M
.EQ
. 0) GO TO 40
85 C Code for equal, positive, non-unit increments.