ext/lbfgsb/src/blas.c in lbfgsb-0.2.0 vs ext/lbfgsb/src/blas.c in lbfgsb-0.3.0
- old
+ new
@@ -3,42 +3,12 @@
* or “3-clause license”)
* Please read attached file License.txt
*/
#include "blas.h"
-double dnrm2_(long *n, double *x, long *incx)
+int lbfgsb_rb_daxpy_(long *n, double *da, double *dx, long *incx, double *dy, long *incy)
{
- long i__1, i__2;
- double ret_val, d__1, d__2, d__3;
- static long i__;
- static double scale;
-
- --x;
-
- ret_val = 0.;
- scale = 0.;
- i__1 = *n;
- i__2 = *incx;
- for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
- d__2 = scale, d__3 = (d__1 = x[i__], fabs(d__1));
- scale = d__2 >= d__3 ? d__2 : d__3;
- }
- if (scale == 0.) {
- return ret_val;
- }
- i__2 = *n;
- i__1 = *incx;
- for (i__ = 1; i__1 < 0 ? i__ >= i__2 : i__ <= i__2; i__ += i__1) {
- d__1 = x[i__] / scale;
- ret_val += d__1 * d__1;
- }
- ret_val = scale * sqrt(ret_val);
- return ret_val;
-}
-
-int daxpy_(long *n, double *da, double *dx, long *incx, double *dy, long *incy)
-{
long i__1;
static long i__, m, ix, iy, mp1;
--dy;
--dx;
@@ -98,11 +68,11 @@
dy[i__ + 3] += *da * dx[i__ + 3];
}
return 0;
}
-int dcopy_(long *n, double *dx, long *incx, double *dy, long *incy)
+int lbfgsb_rb_dcopy_(long *n, double *dx, long *incx, double *dy, long *incy)
{
long i__1;
static long i__, m, ix, iy, mp1;
--dy;
@@ -163,11 +133,11 @@
dy[i__ + 6] = dx[i__ + 6];
}
return 0;
}
-double ddot_(long *n, double *dx, long *incx, double *dy, long *incy)
+double lbfgsb_rb_ddot_(long *n, double *dx, long *incx, double *dy, long *incy)
{
long i__1;
double ret_val;
static long i__, m, ix, iy, mp1;
static double dtemp;
@@ -230,10 +200,10 @@
L60:
ret_val = dtemp;
return ret_val;
}
-int dscal_(long *n, double *da, double *dx, long *incx)
+int lbfgsb_rb_dscal_(long *n, double *da, double *dx, long *incx)
{
long i__1, i__2;
static long i__, m, mp1, nincx;
--dx;