public class JavaBlas extends Object
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 and Description |
---|
JavaBlas() |
Modifier and Type | Method and Description |
---|---|
static 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 + dy
|
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
|
static void |
rzgxpy(int n,
double[] dz,
double[] dx,
double[] dy) |
static void |
rzgxpy(int n,
float[] dz,
float[] dx,
float[] dy) |
public static void rswap(int n, double[] dx, int dxIdx, int incx, double[] dy, int dyIdx, int incy)
public static void rcopy(int n, double[] dx, int dxIdx, int incx, double[] dy, int dyIdx, int incy)
public static void raxpy(int n, double da, double[] dx, int dxIdx, int incx, double[] dy, int dyIdx, int incy)
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)
public static void rzgxpy(int n, double[] dz, double[] dx, double[] dy)
public static double rdot(int n, double[] dx, int dxIdx, int incx, double[] dy, int dyIdx, int incy)
public static void rswap(int n, float[] dx, int dxIdx, int incx, float[] dy, int dyIdx, int incy)
public static void rcopy(int n, float[] dx, int dxIdx, int incx, float[] dy, int dyIdx, int incy)
public static void raxpy(int n, float da, float[] dx, int dxIdx, int incx, float[] dy, int dyIdx, int incy)
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)
public static void rzgxpy(int n, float[] dz, float[] dx, float[] dy)
public static float rdot(int n, float[] dx, int dxIdx, int incx, float[] dy, int dyIdx, int incy)
Copyright © 2015. All rights reserved.