ScaLAPACK 2.1  2.1 ScaLAPACK: Scalable Linear Algebra PACKage
icopy.f
Go to the documentation of this file.
1  SUBROUTINE icopy( N, SX, INCX, SY, INCY )
2 *
3 * -- LAPACK auxiliary test routine (version 3.0) --
4 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
5 * Courant Institute, Argonne National Lab, and Rice University
6 * February 29, 1992
7 *
8 * .. Scalar Arguments ..
9  INTEGER INCX, INCY, N
10 * ..
11 * .. Array Arguments ..
12  INTEGER SX( * ), SY( * )
13 * ..
14 *
15 * Purpose
16 * =======
17 *
18 * ICOPY copies an integer vector x to an integer vector y.
19 * Uses unrolled loops for increments equal to 1.
20 *
21 * Arguments
22 * =========
23 *
24 * N (input) INTEGER
25 * The length of the vectors SX and SY.
26 *
27 * SX (input) INTEGER array, dimension (1+(N-1)*abs(INCX))
28 * The vector X.
29 *
30 * INCX (input) INTEGER
31 * The spacing between consecutive elements of SX.
32 *
33 * SY (output) INTEGER array, dimension (1+(N-1)*abs(INCY))
34 * The vector Y.
35 *
36 * INCY (input) INTEGER
37 * The spacing between consecutive elements of SY.
38 *
39 * =====================================================================
40 *
41 * .. Local Scalars ..
42  INTEGER I, IX, IY, M, MP1
43 * ..
44 * .. Intrinsic Functions ..
45  INTRINSIC mod
46 * ..
47 * .. Executable Statements ..
48 *
49  IF( n.LE.0 )
50  \$ RETURN
51  IF( incx.EQ.1 .AND. incy.EQ.1 )
52  \$ GO TO 20
53 *
54 * Code for unequal increments or equal increments not equal to 1
55 *
56  ix = 1
57  iy = 1
58  IF( incx.LT.0 )
59  \$ ix = ( -n+1 )*incx + 1
60  IF( incy.LT.0 )
61  \$ iy = ( -n+1 )*incy + 1
62  DO 10 i = 1, n
63  sy( iy ) = sx( ix )
64  ix = ix + incx
65  iy = iy + incy
66  10 CONTINUE
67  RETURN
68 *
69 * Code for both increments equal to 1
70 *
71 * Clean-up loop
72 *
73  20 CONTINUE
74  m = mod( n, 7 )
75  IF( m.EQ.0 )
76  \$ GO TO 40
77  DO 30 i = 1, m
78  sy( i ) = sx( i )
79  30 CONTINUE
80  IF( n.LT.7 )
81  \$ RETURN
82  40 CONTINUE
83  mp1 = m + 1
84  DO 50 i = mp1, n, 7
85  sy( i ) = sx( i )
86  sy( i+1 ) = sx( i+1 )
87  sy( i+2 ) = sx( i+2 )
88  sy( i+3 ) = sx( i+3 )
89  sy( i+4 ) = sx( i+4 )
90  sy( i+5 ) = sx( i+5 )
91  sy( i+6 ) = sx( i+6 )
92  50 CONTINUE
93  RETURN
94 *
95 * End of ICOPY
96 *
97  END
icopy
subroutine icopy(N, SX, INCX, SY, INCY)
Definition: pblastst.f:1525