ext/lbfgsb/src/blas.c in lbfgsb-0.4.1 vs ext/lbfgsb/src/blas.c in lbfgsb-0.5.0

- old
+ new

@@ -3,25 +3,25 @@ * or “3-clause license”) * Please read attached file License.txt */ #include "blas.h" -int lbfgsb_rb_daxpy_(long* n, double* da, double* dx, long* incx, double* dy, long* incy) { - long i__1; - static long i__, m, ix, iy, mp1; +void daxpy_(F77_int* n, double* da, double* dx, F77_int* incx, double* dy, F77_int* incy) { + F77_int i__1; + static F77_int i__, m, ix, iy, mp1; --dy; --dx; /* constant times a vector plus a vector. */ /* uses unrolled loops for increments equal to one. */ /* jack dongarra, linpack, 3/11/78. */ if (*n <= 0) { - return 0; + return; } if (*da == 0.) { - return 0; + return; } if (*incx == 1 && *incy == 1) { goto L20; } @@ -39,11 +39,11 @@ for (i__ = 1; i__ <= i__1; ++i__) { dy[iy] += *da * dx[ix]; ix += *incx; iy += *incy; } - return 0; + return; /* code for both increments equal to 1 */ /* clean-up loop */ L20: m = *n % 4; @@ -53,36 +53,36 @@ i__1 = m; for (i__ = 1; i__ <= i__1; ++i__) { dy[i__] += *da * dx[i__]; } if (*n < 4) { - return 0; + return; } L40: mp1 = m + 1; i__1 = *n; for (i__ = mp1; i__ <= i__1; i__ += 4) { dy[i__] += *da * dx[i__]; dy[i__ + 1] += *da * dx[i__ + 1]; dy[i__ + 2] += *da * dx[i__ + 2]; dy[i__ + 3] += *da * dx[i__ + 3]; } - return 0; + return; } -int lbfgsb_rb_dcopy_(long* n, double* dx, long* incx, double* dy, long* incy) { - long i__1; - static long i__, m, ix, iy, mp1; +void dcopy_(F77_int* n, double* dx, F77_int* incx, double* dy, F77_int* incy) { + F77_int i__1; + static F77_int i__, m, ix, iy, mp1; --dy; --dx; /* copies a vector, x, to a vector, y. */ /* uses unrolled loops for increments equal to one. */ /* jack dongarra, linpack, 3/11/78. */ if (*n <= 0) { - return 0; + return; } if (*incx == 1 && *incy == 1) { goto L20; } @@ -100,11 +100,11 @@ for (i__ = 1; i__ <= i__1; ++i__) { dy[iy] = dx[ix]; ix += *incx; iy += *incy; } - return 0; + return; /* code for both increments equal to 1 */ /* clean-up loop */ L20: m = *n % 7; @@ -114,11 +114,11 @@ i__1 = m; for (i__ = 1; i__ <= i__1; ++i__) { dy[i__] = dx[i__]; } if (*n < 7) { - return 0; + return; } L40: mp1 = m + 1; i__1 = *n; for (i__ = mp1; i__ <= i__1; i__ += 7) { @@ -128,17 +128,17 @@ dy[i__ + 3] = dx[i__ + 3]; dy[i__ + 4] = dx[i__ + 4]; dy[i__ + 5] = dx[i__ + 5]; dy[i__ + 6] = dx[i__ + 6]; } - return 0; + return; } -double lbfgsb_rb_ddot_(long* n, double* dx, long* incx, double* dy, long* incy) { - long i__1; +double ddot_(F77_int* n, double* dx, F77_int* incx, double* dy, F77_int* incy) { + F77_int i__1; double ret_val; - static long i__, m, ix, iy, mp1; + static F77_int i__, m, ix, iy, mp1; static double dtemp; --dy; --dx; @@ -197,22 +197,22 @@ L60: ret_val = dtemp; return ret_val; } -int lbfgsb_rb_dscal_(long* n, double* da, double* dx, long* incx) { - long i__1, i__2; - static long i__, m, mp1, nincx; +void dscal_(F77_int* n, double* da, double* dx, F77_int* incx) { + F77_int i__1, i__2; + static F77_int i__, m, mp1, nincx; --dx; /* scales a vector by a constant. */ /* uses unrolled loops for increment equal to one. */ /* jack dongarra, linpack, 3/11/78. */ /* modified 3/93 to return if incx .le. 0. */ if (*n <= 0 || *incx <= 0) { - return 0; + return; } if (*incx == 1) { goto L20; } @@ -221,11 +221,11 @@ i__1 = nincx; i__2 = *incx; for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) { dx[i__] = *da * dx[i__]; } - return 0; + return; /* code for increment equal to 1 */ /* clean-up loop */ L20: m = *n % 5; @@ -235,11 +235,11 @@ i__2 = m; for (i__ = 1; i__ <= i__2; ++i__) { dx[i__] = *da * dx[i__]; } if (*n < 5) { - return 0; + return; } L40: mp1 = m + 1; i__2 = *n; for (i__ = mp1; i__ <= i__2; i__ += 5) { @@ -247,7 +247,7 @@ dx[i__ + 1] = *da * dx[i__ + 1]; dx[i__ + 2] = *da * dx[i__ + 2]; dx[i__ + 3] = *da * dx[i__ + 3]; dx[i__ + 4] = *da * dx[i__ + 4]; } - return 0; + return; }