Blame thirdparty/superlu/SuperLU_4.1/CBLAS/dcopy.c
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* -- translated by f2c (version 19940927).
|
|
kusano |
7d535a |
You must link the resulting object file with the libraries:
|
|
kusano |
7d535a |
-lf2c -lm (in that order)
|
|
kusano |
7d535a |
*/
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#include "f2c.h"
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* Subroutine */ int dcopy_(integer *n, doublereal *dx, integer *incx,
|
|
kusano |
7d535a |
doublereal *dy, integer *incy)
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* System generated locals */
|
|
kusano |
7d535a |
integer i__1;
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* Local variables */
|
|
kusano |
7d535a |
static integer i, m, ix, iy, mp1;
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* copies a vector, x, to a vector, y.
|
|
kusano |
7d535a |
uses unrolled loops for increments equal to one.
|
|
kusano |
7d535a |
jack dongarra, linpack, 3/11/78.
|
|
kusano |
7d535a |
modified 12/3/93, array(1) declarations changed to array(*)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Parameter adjustments
|
|
kusano |
7d535a |
Function Body */
|
|
kusano |
7d535a |
#define DY(I) dy[(I)-1]
|
|
kusano |
7d535a |
#define DX(I) dx[(I)-1]
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
if (*n <= 0) {
|
|
kusano |
7d535a |
return 0;
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
if (*incx == 1 && *incy == 1) {
|
|
kusano |
7d535a |
goto L20;
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* code for unequal increments or equal increments
|
|
kusano |
7d535a |
not equal to 1 */
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
ix = 1;
|
|
kusano |
7d535a |
iy = 1;
|
|
kusano |
7d535a |
if (*incx < 0) {
|
|
kusano |
7d535a |
ix = (-(*n) + 1) * *incx + 1;
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
if (*incy < 0) {
|
|
kusano |
7d535a |
iy = (-(*n) + 1) * *incy + 1;
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
i__1 = *n;
|
|
kusano |
7d535a |
for (i = 1; i <= *n; ++i) {
|
|
kusano |
7d535a |
DY(iy) = DX(ix);
|
|
kusano |
7d535a |
ix += *incx;
|
|
kusano |
7d535a |
iy += *incy;
|
|
kusano |
7d535a |
/* L10: */
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
return 0;
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* code for both increments equal to 1
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
clean-up loop */
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
L20:
|
|
kusano |
7d535a |
m = *n % 7;
|
|
kusano |
7d535a |
if (m == 0) {
|
|
kusano |
7d535a |
goto L40;
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
i__1 = m;
|
|
kusano |
7d535a |
for (i = 1; i <= m; ++i) {
|
|
kusano |
7d535a |
DY(i) = DX(i);
|
|
kusano |
7d535a |
/* L30: */
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
if (*n < 7) {
|
|
kusano |
7d535a |
return 0;
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
L40:
|
|
kusano |
7d535a |
mp1 = m + 1;
|
|
kusano |
7d535a |
i__1 = *n;
|
|
kusano |
7d535a |
for (i = mp1; i <= *n; i += 7) {
|
|
kusano |
7d535a |
DY(i) = DX(i);
|
|
kusano |
7d535a |
DY(i + 1) = DX(i + 1);
|
|
kusano |
7d535a |
DY(i + 2) = DX(i + 2);
|
|
kusano |
7d535a |
DY(i + 3) = DX(i + 3);
|
|
kusano |
7d535a |
DY(i + 4) = DX(i + 4);
|
|
kusano |
7d535a |
DY(i + 5) = DX(i + 5);
|
|
kusano |
7d535a |
DY(i + 6) = DX(i + 6);
|
|
kusano |
7d535a |
/* L50: */
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
return 0;
|
|
kusano |
7d535a |
} /* dcopy_ */
|
|
kusano |
7d535a |
|