Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

dcopy.c

Go to the documentation of this file.
00001 /* DCOPY.F -- translated by f2c (version 19941215).
00002    You must link the resulting object file with the libraries:
00003         -lf2c -lm   (in that order)
00004 */
00005 
00006 #include "f2c.h"      
00007 #include "cblasimpexp.h"
00008 
00009 /* Subroutine */int __IMPEXP__ dcopy_(n, dx, incx, dy, incy)
00010 integer *n;
00011 doublereal *dx;
00012 integer *incx;
00013 doublereal *dy;
00014 integer *incy;
00015 {
00016     /* System generated locals */
00017     integer i__1;
00018 
00019     /* Local variables */
00020     static integer i, m, ix, iy, mp1;
00021 
00022 
00023 /*     copies a vector, x, to a vector, y. */
00024 /*     uses unrolled loops for increments equal to one. */
00025 /*     jack dongarra, linpack, 3/11/78. */
00026 
00027 
00028     /* Parameter adjustments */
00029     --dy;
00030     --dx;
00031 
00032     /* Function Body */
00033     if (*n <= 0) {
00034         return 0;
00035     }
00036     if (*incx == 1 && *incy == 1) {
00037         goto L20;
00038     }
00039 
00040 /*        code for unequal increments or equal increments */
00041 /*          not equal to 1 */
00042 
00043     ix = 1;
00044     iy = 1;
00045     if (*incx < 0) {
00046         ix = (-(*n) + 1) * *incx + 1;
00047     }
00048     if (*incy < 0) {
00049         iy = (-(*n) + 1) * *incy + 1;
00050     }
00051     i__1 = *n;
00052     for (i = 1; i <= i__1; ++i) {
00053         dy[iy] = dx[ix];
00054         ix += *incx;
00055         iy += *incy;
00056 /* L10: */
00057     }
00058     return 0;
00059 
00060 /*        code for both increments equal to 1 */
00061 
00062 
00063 /*        clean-up loop */
00064 
00065 L20:
00066     m = *n % 7;
00067     if (m == 0) {
00068         goto L40;
00069     }
00070     i__1 = m;
00071     for (i = 1; i <= i__1; ++i) {
00072         dy[i] = dx[i];
00073 /* L30: */
00074     }
00075     if (*n < 7) {
00076         return 0;
00077     }
00078 L40:
00079     mp1 = m + 1;
00080     i__1 = *n;
00081     for (i = mp1; i <= i__1; i += 7) {
00082         dy[i] = dx[i];
00083         dy[i + 1] = dx[i + 1];
00084         dy[i + 2] = dx[i + 2];
00085         dy[i + 3] = dx[i + 3];
00086         dy[i + 4] = dx[i + 4];
00087         dy[i + 5] = dx[i + 5];
00088         dy[i + 6] = dx[i + 6];
00089 /* L50: */
00090     }
00091     return 0;
00092 } /* dcopy_ */
00093 

Generated on Wed Sep 5 12:54:19 2007 for DSACSS Operational Code by  doxygen 1.3.9.1