00001 /* icopy.f -- translated by f2c (version 20061008). 00002 You must link the resulting object file with libf2c: 00003 on Microsoft Windows system, link with libf2c.lib; 00004 on Linux or Unix systems, link with .../path/to/libf2c.a -lm 00005 or, if you install libf2c.a in a standard place, with -lf2c -lm 00006 -- in that order, at the end of the command line, as in 00007 cc *.o -lf2c -lm 00008 Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 00009 00010 http://www.netlib.org/f2c/libf2c.zip 00011 */ 00012 00013 #include "f2c.h" 00014 #include "blaswrap.h" 00015 00016 /* Subroutine */ int icopy_(integer *n, integer *sx, integer *incx, integer * 00017 sy, integer *incy) 00018 { 00019 /* System generated locals */ 00020 integer i__1; 00021 00022 /* Local variables */ 00023 integer i__, m, ix, iy, mp1; 00024 00025 00026 /* -- LAPACK auxiliary test routine (version 3.1) -- */ 00027 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 00028 /* November 2006 */ 00029 00030 /* .. Scalar Arguments .. */ 00031 /* .. */ 00032 /* .. Array Arguments .. */ 00033 /* .. */ 00034 00035 /* Purpose */ 00036 /* ======= */ 00037 00038 /* ICOPY copies an integer vector x to an integer vector y. */ 00039 /* Uses unrolled loops for increments equal to 1. */ 00040 00041 /* Arguments */ 00042 /* ========= */ 00043 00044 /* N (input) INTEGER */ 00045 /* The length of the vectors SX and SY. */ 00046 00047 /* SX (input) INTEGER array, dimension (1+(N-1)*abs(INCX)) */ 00048 /* The vector X. */ 00049 00050 /* INCX (input) INTEGER */ 00051 /* The spacing between consecutive elements of SX. */ 00052 00053 /* SY (output) INTEGER array, dimension (1+(N-1)*abs(INCY)) */ 00054 /* The vector Y. */ 00055 00056 /* INCY (input) INTEGER */ 00057 /* The spacing between consecutive elements of SY. */ 00058 00059 /* ===================================================================== */ 00060 00061 /* .. Local Scalars .. */ 00062 /* .. */ 00063 /* .. Intrinsic Functions .. */ 00064 /* .. */ 00065 /* .. Executable Statements .. */ 00066 00067 /* Parameter adjustments */ 00068 --sy; 00069 --sx; 00070 00071 /* Function Body */ 00072 if (*n <= 0) { 00073 return 0; 00074 } 00075 if (*incx == 1 && *incy == 1) { 00076 goto L20; 00077 } 00078 00079 /* Code for unequal increments or equal increments not equal to 1 */ 00080 00081 ix = 1; 00082 iy = 1; 00083 if (*incx < 0) { 00084 ix = (-(*n) + 1) * *incx + 1; 00085 } 00086 if (*incy < 0) { 00087 iy = (-(*n) + 1) * *incy + 1; 00088 } 00089 i__1 = *n; 00090 for (i__ = 1; i__ <= i__1; ++i__) { 00091 sy[iy] = sx[ix]; 00092 ix += *incx; 00093 iy += *incy; 00094 /* L10: */ 00095 } 00096 return 0; 00097 00098 /* Code for both increments equal to 1 */ 00099 00100 /* Clean-up loop */ 00101 00102 L20: 00103 m = *n % 7; 00104 if (m == 0) { 00105 goto L40; 00106 } 00107 i__1 = m; 00108 for (i__ = 1; i__ <= i__1; ++i__) { 00109 sy[i__] = sx[i__]; 00110 /* L30: */ 00111 } 00112 if (*n < 7) { 00113 return 0; 00114 } 00115 L40: 00116 mp1 = m + 1; 00117 i__1 = *n; 00118 for (i__ = mp1; i__ <= i__1; i__ += 7) { 00119 sy[i__] = sx[i__]; 00120 sy[i__ + 1] = sx[i__ + 1]; 00121 sy[i__ + 2] = sx[i__ + 2]; 00122 sy[i__ + 3] = sx[i__ + 3]; 00123 sy[i__ + 4] = sx[i__ + 4]; 00124 sy[i__ + 5] = sx[i__ + 5]; 00125 sy[i__ + 6] = sx[i__ + 6]; 00126 /* L50: */ 00127 } 00128 return 0; 00129 00130 /* End of ICOPY */ 00131 00132 } /* icopy_ */