LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ dcopy()

subroutine dcopy ( integer  N,
double precision, dimension(*)  DX,
integer  INCX,
double precision, dimension(*)  DY,
integer  INCY 
)

DCOPY

Purpose:
    DCOPY copies a vector, x, to a vector, y.
    uses unrolled loops for increments equal to 1.
Parameters
[in]N
          N is INTEGER
         number of elements in input vector(s)
[in]DX
          DX is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
[in]INCX
          INCX is INTEGER
         storage spacing between elements of DX
[out]DY
          DY is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCY ) )
[in]INCY
          INCY is INTEGER
         storage spacing between elements of DY
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2017
Further Details:
     jack dongarra, linpack, 3/11/78.
     modified 12/3/93, array(1) declarations changed to array(*)

Definition at line 84 of file dcopy.f.

84 *
85 * -- Reference BLAS level1 routine (version 3.8.0) --
86 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
87 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
88 * November 2017
89 *
90 * .. Scalar Arguments ..
91  INTEGER INCX,INCY,N
92 * ..
93 * .. Array Arguments ..
94  DOUBLE PRECISION DX(*),DY(*)
95 * ..
96 *
97 * =====================================================================
98 *
99 * .. Local Scalars ..
100  INTEGER I,IX,IY,M,MP1
101 * ..
102 * .. Intrinsic Functions ..
103  INTRINSIC mod
104 * ..
105  IF (n.LE.0) RETURN
106  IF (incx.EQ.1 .AND. incy.EQ.1) THEN
107 *
108 * code for both increments equal to 1
109 *
110 *
111 * clean-up loop
112 *
113  m = mod(n,7)
114  IF (m.NE.0) THEN
115  DO i = 1,m
116  dy(i) = dx(i)
117  END DO
118  IF (n.LT.7) RETURN
119  END IF
120  mp1 = m + 1
121  DO i = mp1,n,7
122  dy(i) = dx(i)
123  dy(i+1) = dx(i+1)
124  dy(i+2) = dx(i+2)
125  dy(i+3) = dx(i+3)
126  dy(i+4) = dx(i+4)
127  dy(i+5) = dx(i+5)
128  dy(i+6) = dx(i+6)
129  END DO
130  ELSE
131 *
132 * code for unequal increments or equal increments
133 * not equal to 1
134 *
135  ix = 1
136  iy = 1
137  IF (incx.LT.0) ix = (-n+1)*incx + 1
138  IF (incy.LT.0) iy = (-n+1)*incy + 1
139  DO i = 1,n
140  dy(iy) = dx(ix)
141  ix = ix + incx
142  iy = iy + incy
143  END DO
144  END IF
145  RETURN