BLAS and LAPACK interface for MArrays
[Multidimensional Dynamic Arrays]


Detailed Description

Interface to call BLAS and LAPACK functions on MArrays of dimensions one and two.

Function Documentation

template<typename T>
blas_dot_dispatch<T>::value_type blas_dot ( const MArray< T, 1 > &  x,
const MArray< T, 1 > &  y 
) [inline]

BLAS Level 1 functions

Compute the dot product of two n-element vectors x and y: x dot y = SUM(i=1...n,x(i)y(i)) = x(1)y(1) + x(2)y(2) + ... + x(n)y(n)

The MArrays x and y may have strides unequal 1, hence they may be views, slices, or subarrays of higher-dimensional MArrays

The order of operations is different from the order in a sequential evalua- tion of the dot product. The final result can differ from the result of a sequential evaluation. Returns the value in double-precision.

template<typename T>
void blas_gemv ( const T  alpha,
const MArray< T, 2 > &  A,
const MArray< T, 1 > &  x,
const T  beta,
MArray< T, 2 > &  y,
const bool  transA = false 
) [inline]

BLAS Level 2 functions

The Xgemv() routine compute a matrix-vector product for of either a general matrix or its transpose: y = alpha*Ax + beta*y y = alpha*transp(A)*x + beta*y

The MArrays x and y may have strides unequal 1, hence they may be views, slices, or subarrays of higher-dimensional MArrays. The matrix A needs to have contiguous storage.

The vector y is overwritted with the result of the calculation. If transA==false, the length of y has to be M, otherwise N.

template<typename T>
void blas_gemm ( const T  alpha,
const MArray< T, 2 > &  A,
const MArray< T, 2 > &  B,
const T  beta,
MArray< T, 2 > &  C,
const bool  transA = false,
const bool  transB = false 
) [inline]

BLAS Level 3 functions

This routine performs the following operation: C = alpha(op)A(op)B + beta*C where (op)(X) = X, transp(X), alpha and beta are scalars, and A, B, and C are matrices.

(op)A is an m by k matrix, (op)B is a k by n matrix, and C is an m by n matrix. The matrices need to have contiguous storage.

A and B are unchanged on exit, C is overwritten with A dot B.

template<typename T>
bool lapack_gesv ( MArray< T, 2 > &  A,
MArray< T, 1 > &  b 
) [inline]

LAPACK Functions

GESV computes the solution to a system of linear equations A * x = b, where A is an N-by-N matrix and x and b are N-vectors.

LU decomposition with partial pivoting and row interchanges is used to factor A as A = P * L * U, where P is a permutation matrix, L is unit lower triangular, and U is upper triangular. The factored form of A is then used to solve the system of equations A * x = b.

The matrix A is replaced by L and U. The vector b is unchanged. The vector b is overwritten with the solution of Ax=b.

template<typename T>
void blas_axpy ( const MArray< T, 1 > &  x,
const T  alpha,
MArray< T, 1 > &  y 
) [inline]

The _AXPY functions compute the following scalar-vector product and sum: y = alpha*x+y where alpha is a scalar, and x and y are single-precision vectors.

If any element of x or the scalar alpha share a memory location with an element of y, the results are unpredictable.

The MArrays x and y may have strides unequal 1, hence they may be views, slices, or subarrays of higher-dimensional MArrays

The vector y is overwritted with the result of the calculation.

template<typename T>
MArray<T,1> blas_gemv ( const MArray< T, 2 > &  A,
const MArray< T, 1 > &  x,
const bool  transA = false 
) [inline]

The Xgemv() routine compute a matrix-vector product for double-precision data of either a general matrix or its transpose: y = Ax y = transp(A)*x

The MArrays x may have strides unequal 1, hence it may be a view, slice, or subarray of a higher-dimensional MArray The matrix A needs to have contiguous storage.

The result of the calculation is returned in a newly allocated MArray.

template<typename T>
bool lapack_gesv ( MArray< T, 2 > &  A,
MArray< T, 2 > &  B 
) [inline]

GESV computes the solution to Nrhs systems of linear equations A * X = B, where A is an N-by-N matrix and X and B are N x Nrhs-matrices.

LU decomposition with partial pivoting and row interchanges is used to factor A as A = P * L * U, where P is a permutation matrix, L is unit lower triangular, and U is upper triangular. The factored form of A is then used to solve the system of equations A * x = b.

The matrix A is replaced by L and U. The Matrix B is overwritten with the solutions of A x_i = b_i, where x_i and b_i are the column vectors of X and B


Generated on Wed Mar 11 17:44:35 2009 for LTL by  doxygen 1.5.3