 LAPACK 3.11.0 LAPACK: Linear Algebra PACKage
Searching...
No Matches

## ◆ icopy()

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

ICOPY

Purpose:
``` ICOPY copies an integer vector x to an integer vector y.
Uses unrolled loops for increments equal to 1.```
Parameters
 [in] N ``` N is INTEGER The length of the vectors SX and SY.``` [in] SX ``` SX is INTEGER array, dimension (1+(N-1)*abs(INCX)) The vector X.``` [in] INCX ``` INCX is INTEGER The spacing between consecutive elements of SX.``` [out] SY ``` SY is INTEGER array, dimension (1+(N-1)*abs(INCY)) The vector Y.``` [in] INCY ``` INCY is INTEGER The spacing between consecutive elements of SY.```

Definition at line 74 of file icopy.f.

75*
76* -- LAPACK test routine --
77* -- LAPACK is a software package provided by Univ. of Tennessee, --
78* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
79*
80* .. Scalar Arguments ..
81 INTEGER INCX, INCY, N
82* ..
83* .. Array Arguments ..
84 INTEGER SX( * ), SY( * )
85* ..
86*
87* =====================================================================
88*
89* .. Local Scalars ..
90 INTEGER I, IX, IY, M, MP1
91* ..
92* .. Intrinsic Functions ..
93 INTRINSIC mod
94* ..
95* .. Executable Statements ..
96*
97 IF( n.LE.0 )
98 \$ RETURN
99 IF( incx.EQ.1 .AND. incy.EQ.1 )
100 \$ GO TO 20
101*
102* Code for unequal increments or equal increments not equal to 1
103*
104 ix = 1
105 iy = 1
106 IF( incx.LT.0 )
107 \$ ix = ( -n+1 )*incx + 1
108 IF( incy.LT.0 )
109 \$ iy = ( -n+1 )*incy + 1
110 DO 10 i = 1, n
111 sy( iy ) = sx( ix )
112 ix = ix + incx
113 iy = iy + incy
114 10 CONTINUE
115 RETURN
116*
117* Code for both increments equal to 1
118*
119* Clean-up loop
120*
121 20 CONTINUE
122 m = mod( n, 7 )
123 IF( m.EQ.0 )
124 \$ GO TO 40
125 DO 30 i = 1, m
126 sy( i ) = sx( i )
127 30 CONTINUE
128 IF( n.LT.7 )
129 \$ RETURN
130 40 CONTINUE
131 mp1 = m + 1
132 DO 50 i = mp1, n, 7
133 sy( i ) = sx( i )
134 sy( i+1 ) = sx( i+1 )
135 sy( i+2 ) = sx( i+2 )
136 sy( i+3 ) = sx( i+3 )
137 sy( i+4 ) = sx( i+4 )
138 sy( i+5 ) = sx( i+5 )
139 sy( i+6 ) = sx( i+6 )
140 50 CONTINUE
141 RETURN
142*
143* End of ICOPY
144*
Here is the caller graph for this function: