All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class array.Blas

java.lang.Object
   |
   +----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.

The purpose of this current implementation is to serve as an example of interfaces. Therefore, only three operations are coded: dgemm, dgemv, and ddot. Please note that the operations are coded for clarity, not performance.


Variable Index

 o NoTranspose
 o Transpose

Constructor Index

 o Blas()

Method Index

 o ddot(doubleArray1D, doubleArray1D)
BLAS ddot routine: s = x^T * y.
 o dgemm(boolean, boolean, double, doubleArray2D, doubleArray2D, double, doubleArray2D)
BLAS dgemm routine: C = alpha*A*B + beta*C.
 o dgemv(boolean, double, doubleArray2D, doubleArray1D, double, doubleArray1D)
BLAS dgemv routine: y = alpha*A*x + beta*y.

Variables

 o NoTranspose
 public static final boolean NoTranspose
 o Transpose
 public static final boolean Transpose

Constructors

 o Blas
 public Blas()

Methods

 o dgemm
 public static void dgemm(boolean transa,
                          boolean 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
 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
Throws: NonconformingArrayException
x and y must be of same length
 o dgemv
 public static void dgemv(boolean 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

All Packages  Class Hierarchy  This Package  Previous  Next  Index