dcopy.c
Go to the documentation of this file.
00001 /* dcopy.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 dcopy_(integer *n, doublereal *dx, integer *incx, 
00017         doublereal *dy, integer *incy)
00018 {
00019     /* System generated locals */
00020     integer i__1;
00021 
00022     /* Local variables */
00023     integer i__, m, ix, iy, mp1;
00024 
00025 /*     .. Scalar Arguments .. */
00026 /*     .. */
00027 /*     .. Array Arguments .. */
00028 /*     .. */
00029 
00030 /*  Purpose */
00031 /*  ======= */
00032 
00033 /*     copies a vector, x, to a vector, y. */
00034 /*     uses unrolled loops for increments equal to one. */
00035 /*     jack dongarra, linpack, 3/11/78. */
00036 /*     modified 12/3/93, array(1) declarations changed to array(*) */
00037 
00038 
00039 /*     .. Local Scalars .. */
00040 /*     .. */
00041 /*     .. Intrinsic Functions .. */
00042 /*     .. */
00043     /* Parameter adjustments */
00044     --dy;
00045     --dx;
00046 
00047     /* Function Body */
00048     if (*n <= 0) {
00049         return 0;
00050     }
00051     if (*incx == 1 && *incy == 1) {
00052         goto L20;
00053     }
00054 
00055 /*        code for unequal increments or equal increments */
00056 /*          not equal to 1 */
00057 
00058     ix = 1;
00059     iy = 1;
00060     if (*incx < 0) {
00061         ix = (-(*n) + 1) * *incx + 1;
00062     }
00063     if (*incy < 0) {
00064         iy = (-(*n) + 1) * *incy + 1;
00065     }
00066     i__1 = *n;
00067     for (i__ = 1; i__ <= i__1; ++i__) {
00068         dy[iy] = dx[ix];
00069         ix += *incx;
00070         iy += *incy;
00071 /* L10: */
00072     }
00073     return 0;
00074 
00075 /*        code for both increments equal to 1 */
00076 
00077 
00078 /*        clean-up loop */
00079 
00080 L20:
00081     m = *n % 7;
00082     if (m == 0) {
00083         goto L40;
00084     }
00085     i__1 = m;
00086     for (i__ = 1; i__ <= i__1; ++i__) {
00087         dy[i__] = dx[i__];
00088 /* L30: */
00089     }
00090     if (*n < 7) {
00091         return 0;
00092     }
00093 L40:
00094     mp1 = m + 1;
00095     i__1 = *n;
00096     for (i__ = mp1; i__ <= i__1; i__ += 7) {
00097         dy[i__] = dx[i__];
00098         dy[i__ + 1] = dx[i__ + 1];
00099         dy[i__ + 2] = dx[i__ + 2];
00100         dy[i__ + 3] = dx[i__ + 3];
00101         dy[i__ + 4] = dx[i__ + 4];
00102         dy[i__ + 5] = dx[i__ + 5];
00103         dy[i__ + 6] = dx[i__ + 6];
00104 /* L50: */
00105     }
00106     return 0;
00107 } /* dcopy_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:39