All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.math.array.Blas
java.lang.Object
|
+----com.ibm.math.array.Blas
- public class Blas
- extends Object
Blas = Basic Linear Algebra Subprograms for the Array package.
This class implements the BLAS functions for operations on
arrays from the array package.
It follows the spirit of the
"Draft Proposal for Java BLAS Interface", by Roldan Pozo of the
National Institute of Standards and Technology.
Because the array package supports sections, the interface is
actually simpler.
This version is still under development. Currently, the
following operations are supported:
- BLAS Level 1: Vector-Vector operations
- ddot : dot product of two vectors
- daxpy : scalar times a vector plus a vector
- drotg : construct a Givens plane rotation
- drot : apply a plane rotation
- dcopy : copy vector X to vector Y
- dswap : interchange vectors X and Y
- dnrm2 : Euclidean norm of a vector
- dasum : sum of absolute values of vector components
- dscal : scale a vector by a scalar
- idamax : index of element with maximum absolute value
- BLAS Level 2: Matrix-Vector operations
- dgemv : matrix-vector multiply with general matrix
- dger : rank-1 update on general matrix
- dsymv : matrix-vector multiply with symmetric matrix
- dtrmv : matrix-vector multiply with triangular matrix
- BLAS Level 3: Matrix-Matrix operations
- dgemm : matrix-matrix multiply with general matrices
-
Left
- Matrix is on the left side of operation.
-
Lower
- Matrix is lower triangular.
-
NoTranspose
- Do not transpose input matrix.
-
NotUnitDiagonal
- Matrix is not unit diagonal.
-
Right
- Matrix is on the right side of operation.
-
Transpose
- Transpose input matrix.
-
UnitDiagonal
- Matrix is unit diagonal.
-
Upper
- Matrix is upper triangular.
-
dasum(doubleArray1D)
- BLAS dasum routine: |x_0| + |x_1| + ...
-
daxpy(double, doubleArray1D, doubleArray1D)
- BLAS daxpy routine: y = y + alpha*x.
-
dcopy(doubleArray1D, doubleArray1D)
- BLAS dcopy routine: y = x.
-
ddot(doubleArray1D, doubleArray1D)
- BLAS ddot routine: s = x^T * y.
-
dgemm(int, int, double, doubleArray2D, doubleArray2D, double, doubleArray2D)
- BLAS dgemm routine: C = alpha*A*B + beta*C.
-
dgemv(int, double, doubleArray2D, doubleArray1D, double, doubleArray1D)
- BLAS dgemv routine: y = alpha*A*x + beta*y.
-
dger(double, doubleArray1D, doubleArray1D, doubleArray2D)
- BLAS dger routine: a = a + alpha*x*y^T.
-
dnrm2(doubleArray1D)
- BLAS dnrm2 routine: sqrt(x_0^2 + x_1^2 + ...).
-
drot(doubleArray1D, doubleArray1D, double, double)
- BLAS drot routine: x = c*x + s*y, y = c*y - s*x.
-
drotg(double, double)
- BLAS drotg routine: Givens rotation for (a,b).
-
dscal(double, doubleArray1D)
- BLAS dscal routine: x = alpha*x.
-
dswap(doubleArray1D, doubleArray1D)
- BLAS dswap routine: y <- -> x.
-
dsymv(int, double, doubleArray2D, doubleArray1D, double, doubleArray1D)
- BLAS dsymv routine: y = alpha*A*x + beta*y.
-
dtrmv(int, int, int, doubleArray2D, doubleArray1D)
- BLAS dtrmv routine: x = A*x.
-
idamax(doubleArray1D)
- BLAS idamax routine: i such that |x_i| == max(|x_0|,|x_1|,...).
NoTranspose
public static final int NoTranspose
- Do not transpose input matrix.
Transpose
public static final int Transpose
- Transpose input matrix.
Right
public static final int Right
- Matrix is on the right side of operation.
Left
public static final int Left
- Matrix is on the left side of operation.
UnitDiagonal
public static final int UnitDiagonal
- Matrix is unit diagonal.
NotUnitDiagonal
public static final int NotUnitDiagonal
- Matrix is not unit diagonal.
Upper
public static final int Upper
- Matrix is upper triangular.
Lower
public static final int Lower
- Matrix is lower triangular.
ddot
public static double ddot(doubleArray1D x,
doubleArray1D y) throws NonconformingArrayException
- BLAS ddot routine: s = x^T * y.
- Parameters:
- x - vector x
- y - vector y
- Returns:
- double dot-product of x and y
- Throws: NonconformingArrayException
- x and y must be of same length
daxpy
public static void daxpy(double alpha,
doubleArray1D x,
doubleArray1D y) throws NonconformingArrayException
- BLAS daxpy routine: y = y + alpha*x.
- Parameters:
- alpha - multiplier for x
- x - vector x
- y - vector y
- Throws: NonconformingArrayException
- shapes do not match
drotg
public static GivensRotation drotg(double a,
double b)
- BLAS drotg routine: Givens rotation for (a,b).
- Parameters:
- a - rotational elimination parameter a
- b - rotational elimination parameter b
- Returns:
- GivensRotation Givens plane rotation
drot
public static void drot(doubleArray1D x,
doubleArray1D y,
double c,
double s) throws NonconformingArrayException
- BLAS drot routine: x = c*x + s*y, y = c*y - s*x.
- Parameters:
- x - vector x
- y - vector y
- c - cosine of the angle of rotation
- s - sine of the angle of rotation
dcopy
public static void dcopy(doubleArray1D x,
doubleArray1D y) throws NonconformingArrayException
- BLAS dcopy routine: y = x.
- Parameters:
- x - vector x
- y - vector y
- Throws: NonconformingArrayException
- shapes do not match
dswap
public static void dswap(doubleArray1D x,
doubleArray1D y) throws NonconformingArrayException
- BLAS dswap routine: y <- -> x.
- Parameters:
- x - vector x
- y - vector y
- Throws: NonconformingArrayException
- shapes do not match
dnrm2
public static double dnrm2(doubleArray1D x)
- BLAS dnrm2 routine: sqrt(x_0^2 + x_1^2 + ...).
- Parameters:
- x - vector x
- Returns:
- double norm 2 of x
dasum
public static double dasum(doubleArray1D x)
- BLAS dasum routine: |x_0| + |x_1| + ...
- Parameters:
- x - vector x
- Returns:
- double sum of absolute values of elements of x
dscal
public static void dscal(double alpha,
doubleArray1D x)
- BLAS dscal routine: x = alpha*x.
- Parameters:
- alpha - multiplier for x
- x - vector x
idamax
public static int idamax(doubleArray1D x)
- BLAS idamax routine: i such that |x_i| == max(|x_0|,|x_1|,...).
- Parameters:
- x - vector x
- Returns:
- int index of largest absolute value (-1 if x empty)
dgemv
public static void dgemv(int transa,
double alpha,
doubleArray2D a,
doubleArray1D x,
double beta,
doubleArray1D y) throws NonconformingArrayException
- BLAS dgemv routine: y = alpha*A*x + beta*y.
- Parameters:
- transa - indicates if A is to be transposed
- alpha - multiplier for A*x
- a - matrix A
- x - vector x
- beta - multiplier for y
- y - vector y
- Throws: NonconformingArrayException
- shapes do not match
dsymv
public static void dsymv(int uplo,
double alpha,
doubleArray2D a,
doubleArray1D x,
double beta,
doubleArray1D y) throws NonconformingArrayException
- BLAS dsymv routine: y = alpha*A*x + beta*y.
- Parameters:
- uplo - indicates if A is stored in upper or lower format
- alpha - multiplier for A*x
- a - matrix A
- x - vector x
- beta - multiplier for y
- y - vector y
- Throws: NonconformingArrayException
- shapes do not match
dtrmv
public static void dtrmv(int uplo,
int transa,
int diag,
doubleArray2D a,
doubleArray1D x) throws NonconformingArrayException
- BLAS dtrmv routine: x = A*x.
- Parameters:
- uplo - indicates if A is stored in upper or lower format
- transa - indicates if A is to be transposed or not
- diag - indicates if A is unit triangular or not
- a - matrix A
- x - vector x
- Throws: NonconformingArrayException
- shapes do not match
dger
public static void dger(double alpha,
doubleArray1D x,
doubleArray1D y,
doubleArray2D a) throws NonconformingArrayException
- BLAS dger routine: a = a + alpha*x*y^T.
- Parameters:
- alpha - multiplier for x*y^T
- x - vector x
- y - vector y
- a - matrix a
- Throws: NonconformingArrayException
- shapes do not match
dgemm
public static void dgemm(int transa,
int transb,
double alpha,
doubleArray2D a,
doubleArray2D b,
double beta,
doubleArray2D c) throws NonconformingArrayException
- BLAS dgemm routine: C = alpha*A*B + beta*C.
- Parameters:
- transa - indicates if A is to be transposed
- transb - indicates if B is to be transposed
- alpha - multiplier for A*B
- a - matrix A
- b - matrix B
- beta - multiplier for C
- c - matrix C
- Throws: NonconformingArrayException
- shapes do not match
All Packages Class Hierarchy This Package Previous Next Index