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:

  1. BLAS Level 1: Vector-Vector operations
  2. BLAS Level 2: Matrix-Vector operations
  3. BLAS Level 3: Matrix-Matrix operations


Variable Index

 o Left
Matrix is on the left side of operation.
 o Lower
Matrix is lower triangular.
 o NoTranspose
Do not transpose input matrix.
 o NotUnitDiagonal
Matrix is not unit diagonal.
 o Right
Matrix is on the right side of operation.
 o Transpose
Transpose input matrix.
 o UnitDiagonal
Matrix is unit diagonal.
 o Upper
Matrix is upper triangular.

Method Index

 o dasum(doubleArray1D)
BLAS dasum routine: |x_0| + |x_1| + ...
 o daxpy(double, doubleArray1D, doubleArray1D)
BLAS daxpy routine: y = y + alpha*x.
 o dcopy(doubleArray1D, doubleArray1D)
BLAS dcopy routine: y = x.
 o ddot(doubleArray1D, doubleArray1D)
BLAS ddot routine: s = x^T * y.
 o dgemm(int, int, double, doubleArray2D, doubleArray2D, double, doubleArray2D)
BLAS dgemm routine: C = alpha*A*B + beta*C.
 o dgemv(int, double, doubleArray2D, doubleArray1D, double, doubleArray1D)
BLAS dgemv routine: y = alpha*A*x + beta*y.
 o dger(double, doubleArray1D, doubleArray1D, doubleArray2D)
BLAS dger routine: a = a + alpha*x*y^T.
 o dnrm2(doubleArray1D)
BLAS dnrm2 routine: sqrt(x_0^2 + x_1^2 + ...).
 o drot(doubleArray1D, doubleArray1D, double, double)
BLAS drot routine: x = c*x + s*y, y = c*y - s*x.
 o drotg(double, double)
BLAS drotg routine: Givens rotation for (a,b).
 o dscal(double, doubleArray1D)
BLAS dscal routine: x = alpha*x.
 o dswap(doubleArray1D, doubleArray1D)
BLAS dswap routine: y <- -> x.
 o dsymv(int, double, doubleArray2D, doubleArray1D, double, doubleArray1D)
BLAS dsymv routine: y = alpha*A*x + beta*y.
 o dtrmv(int, int, int, doubleArray2D, doubleArray1D)
BLAS dtrmv routine: x = A*x.
 o idamax(doubleArray1D)
BLAS idamax routine: i such that |x_i| == max(|x_0|,|x_1|,...).

Variables

 o NoTranspose
 public static final int NoTranspose
Do not transpose input matrix.

 o Transpose
 public static final int Transpose
Transpose input matrix.

 o Right
 public static final int Right
Matrix is on the right side of operation.

 o Left
 public static final int Left
Matrix is on the left side of operation.

 o UnitDiagonal
 public static final int UnitDiagonal
Matrix is unit diagonal.

 o NotUnitDiagonal
 public static final int NotUnitDiagonal
Matrix is not unit diagonal.

 o Upper
 public static final int Upper
Matrix is upper triangular.

 o Lower
 public static final int Lower
Matrix is lower triangular.

Methods

 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o dscal
 public static void dscal(double alpha,
                          doubleArray1D x)
BLAS dscal routine: x = alpha*x.

Parameters:
alpha - multiplier for x
x - vector x
 o 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)
 o 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
 o 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
 o 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
 o 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
 o 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