Package org.jblas
Class JavaBlas
java.lang.Object
org.jblas.JavaBlas
Implementation of some Blas functions, mostly those which require linear runtime in the number of matrix elements. Because of the copying overhead when passing primitive arrays to native code, it doesn't make sense for these functions to be implemented in native code. The Java code is about as fast.
The same conventions were used as in the native code, that is, for each array you also pass an index pointing to the starting index.
These methods are mostly optimized for the case where the starting index is 0 and the increment is 1.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
raxpy
(int n, double da, double[] dx, int dxIdx, int incx, double[] dy, int dyIdx, int incy) Compute dy <- da * dx + dy.static void
raxpy
(int n, float da, float[] dx, int dxIdx, int incx, float[] dy, int dyIdx, int incy) Compute dy <- da * dx + dy.static void
rcopy
(int n, double[] dx, int dxIdx, int incx, double[] dy, int dyIdx, int incy) Copy dx to dy.static void
rcopy
(int n, float[] dx, int dxIdx, int incx, float[] dy, int dyIdx, int incy) Copy dx to dy.static double
rdot
(int n, double[] dx, int dxIdx, int incx, double[] dy, int dyIdx, int incy) Compute scalar product between dx and dy.static float
rdot
(int n, float[] dx, int dxIdx, int incx, float[] dy, int dyIdx, int incy) Compute scalar product between dx and dy.static void
rswap
(int n, double[] dx, int dxIdx, int incx, double[] dy, int dyIdx, int incy) Exchange two vectors.static void
rswap
(int n, float[] dx, int dxIdx, int incx, float[] dy, int dyIdx, int incy) Exchange two vectors.static void
rzaxpy
(int n, double[] dz, int dzIdx, int incz, double da, double[] dx, int dxIdx, int incx, double[] dy, int dyIdx, int incy) Computes dz <- dx + dystatic void
rzaxpy
(int n, float[] dz, int dzIdx, int incz, float da, float[] dx, int dxIdx, int incx, float[] dy, int dyIdx, int incy) Computes dz <- dx + dystatic void
rzgxpy
(int n, double[] dz, double[] dx, double[] dy) static void
rzgxpy
(int n, float[] dz, float[] dx, float[] dy)
-
Constructor Details
-
JavaBlas
public JavaBlas()
-
-
Method Details
-
rswap
Exchange two vectors. -
rcopy
Copy dx to dy. -
raxpy
public static void raxpy(int n, double da, double[] dx, int dxIdx, int incx, double[] dy, int dyIdx, int incy) Compute dy <- da * dx + dy. -
rzaxpy
public static void rzaxpy(int n, double[] dz, int dzIdx, int incz, double da, double[] dx, int dxIdx, int incx, double[] dy, int dyIdx, int incy) Computes dz <- dx + dy -
rzgxpy
-
rdot
public static double rdot(int n, double[] dx, int dxIdx, int incx, double[] dy, int dyIdx, int incy) Compute scalar product between dx and dy. -
rswap
Exchange two vectors. -
rcopy
Copy dx to dy. -
raxpy
public static void raxpy(int n, float da, float[] dx, int dxIdx, int incx, float[] dy, int dyIdx, int incy) Compute dy <- da * dx + dy. -
rzaxpy
public static void rzaxpy(int n, float[] dz, int dzIdx, int incz, float da, float[] dx, int dxIdx, int incx, float[] dy, int dyIdx, int incy) Computes dz <- dx + dy -
rzgxpy
-
rdot
Compute scalar product between dx and dy.
-