LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ scopy()

subroutine scopy ( integer  N,
real, dimension(*)  SX,
integer  INCX,
real, dimension(*)  SY,
integer  INCY 
)

SCOPY

Purpose:
    SCOPY 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]SX
          SX is REAL array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
[in]INCX
          INCX is INTEGER
         storage spacing between elements of SX
[out]SY
          SY is REAL array, dimension ( 1 + ( N - 1 )*abs( INCY ) )
[in]INCY
          INCY is INTEGER
         storage spacing between elements of SY
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
     jack dongarra, linpack, 3/11/78.
     modified 12/3/93, array(1) declarations changed to array(*)

Definition at line 81 of file scopy.f.

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