Teuchos::BLAS< OrdinalType, ScalarType > Class Template Reference

The Templated BLAS Wrapper Class. More...

#include <Teuchos_BLAS.hpp>

Inheritance diagram for Teuchos::BLAS< OrdinalType, ScalarType >:

[legend]
List of all members.

Public Member Functions

Constructor/Destructor.
 BLAS (void)
 Default constructor.
 BLAS (const BLAS< OrdinalType, ScalarType > &BLAS_source)
 Copy constructor.
virtual ~BLAS (void)
 Destructor.
Level 1 BLAS Routines.
void ROTG (ScalarType *da, ScalarType *db, ScalarType *c, ScalarType *s) const
 Computes a Givens plane rotation.
void SCAL (const OrdinalType n, const ScalarType alpha, ScalarType *x, const OrdinalType incx) const
 Scale the vector x by the constant alpha.
void COPY (const OrdinalType n, const ScalarType *x, const OrdinalType incx, ScalarType *y, const OrdinalType incy) const
 Copy the vector x to the vector y.
void AXPY (const OrdinalType n, const ScalarType alpha, const ScalarType *x, const OrdinalType incx, ScalarType *y, const OrdinalType incy) const
 Perform the operation: y <- y+alpha*x.
ScalarType ASUM (const OrdinalType n, const ScalarType *x, const OrdinalType incx) const
 Sum the absolute values of the entries of x.
ScalarType DOT (const OrdinalType n, const ScalarType *x, const OrdinalType incx, const ScalarType *y, const OrdinalType incy) const
 Form the dot product of the vectors x and y.
ScalarType NRM2 (const OrdinalType n, const ScalarType *x, const OrdinalType incx) const
 Compute the 2-norm of the vector x.
OrdinalType IAMAX (const OrdinalType n, const ScalarType *x, const OrdinalType incx) const
 Return the index of the element of x with the maximum magnitude.
Level 2 BLAS Routines.
void GEMV (ETransp trans, const OrdinalType m, const OrdinalType n, const ScalarType alpha, const ScalarType *A, const OrdinalType lda, const ScalarType *x, const OrdinalType incx, const ScalarType beta, ScalarType *y, const OrdinalType incy) const
 Performs the matrix-vector operation: y <- alpha*A*x+beta*y or y <- alpha*A'*x+beta*y where A is a general m by n matrix.
void TRMV (EUplo uplo, ETransp trans, EDiag diag, const OrdinalType n, const ScalarType *A, const OrdinalType lda, ScalarType *x, const OrdinalType incx) const
 Performs the matrix-vector operation: x <- A*x or x <- A'*x where A is a unit/non-unit n by n upper/lower triangular matrix.
void GER (const OrdinalType m, const OrdinalType n, const ScalarType alpha, const ScalarType *x, const OrdinalType incx, const ScalarType *y, const OrdinalType incy, ScalarType *A, const OrdinalType lda) const
 Performs the rank 1 operation: A <- alpha*x*y'+A.
Level 3 BLAS Routines.
void GEMM (ETransp transa, ETransp transb, const OrdinalType m, const OrdinalType n, const OrdinalType k, const ScalarType alpha, const ScalarType *A, const OrdinalType lda, const ScalarType *B, const OrdinalType ldb, const ScalarType beta, ScalarType *C, const OrdinalType ldc) const
 Performs the matrix-matrix operation: C <- alpha*op(A)*op(B)+beta*C where op(A) is either A or A', op(B) is either B or B', and C is an m by k matrix.
void SYMM (ESide side, EUplo uplo, const OrdinalType m, const OrdinalType n, const ScalarType alpha, const ScalarType *A, const OrdinalType lda, const ScalarType *B, const OrdinalType ldb, const ScalarType beta, ScalarType *C, const OrdinalType ldc) const
 Performs the matrix-matrix operation: C <- alpha*A*B+beta*C or C <- alpha*B*A+beta*C where A is an m by m or n by n symmetric matrix and B is a general matrix.
void TRMM (ESide side, EUplo uplo, ETransp transa, EDiag diag, const OrdinalType m, const OrdinalType n, const ScalarType alpha, const ScalarType *A, const OrdinalType lda, ScalarType *B, const OrdinalType ldb) const
 Performs the matrix-matrix operation: C <- alpha*op(A)*B+beta*C or C <- alpha*B*op(A)+beta*C where op(A) is an unit/non-unit, upper/lower triangular matrix and B is a general matrix.
void TRSM (ESide side, EUplo uplo, ETransp transa, EDiag diag, const OrdinalType m, const OrdinalType n, const ScalarType alpha, const ScalarType *A, const OrdinalType lda, ScalarType *B, const OrdinalType ldb) const
 Solves the matrix equations: op(A)*X=alpha*B or X*op(A)=alpha*B where X and B are m by n matrices, A is a unit/non-unit, upper/lower triangular matrix and op(A) is A or A'. The matrix X is overwritten on B.

Detailed Description

template<typename OrdinalType, typename ScalarType>
class Teuchos::BLAS< OrdinalType, ScalarType >

The Templated BLAS Wrapper Class.

The Teuchos::BLAS class provides functionality similar to the BLAS (Basic Linear Algebra Subprograms). The BLAS provide portable, high- performance implementations of kernels such as dense vector multiplication, dot products, dense matrix-vector multiplication and dense matrix-matrix multiplication.

The standard BLAS interface is Fortran-specific. Unfortunately, the interface between C++ and Fortran is not standard across all computer platforms. The Teuchos_BLAS class provides C++ bindings for the BLAS kernels in order to insulate the rest of Petra from the details of C++ to Fortran translation.

In addition to giving access the standard BLAS functionality. Teuchos::BLAS also provide functionality for any <scalartype> class that defines the +, - * and / operators.

Teuchos::BLAS is a single memory image interface only. This is appropriate since the standard BLAS are only specified for serial execution (or shared memory parallel).

Note:
  1. These templates are specialized to use the Fortran BLAS routines for scalar types float and double.

  2. If Teuchos is configured with --enable-teuchos-complex then these templates are specialized for scalar types complex<float> and complex<double> also.
Examples:

BLAS/cxx_main.cpp.

Definition at line 120 of file Teuchos_BLAS.hpp.


Constructor & Destructor Documentation

template<typename OrdinalType, typename ScalarType>
Teuchos::BLAS< OrdinalType, ScalarType >::BLAS void   )  [inline]
 

Default constructor.

Definition at line 126 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
Teuchos::BLAS< OrdinalType, ScalarType >::BLAS const BLAS< OrdinalType, ScalarType > &  BLAS_source  )  [inline]
 

Copy constructor.

Definition at line 129 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
virtual Teuchos::BLAS< OrdinalType, ScalarType >::~BLAS void   )  [inline, virtual]
 

Destructor.

Definition at line 132 of file Teuchos_BLAS.hpp.


Member Function Documentation

template<typename OrdinalType, typename ScalarType>
void Teuchos::BLAS< OrdinalType, ScalarType >::ROTG ScalarType *  da,
ScalarType *  db,
ScalarType *  c,
ScalarType *  s
const
 

Computes a Givens plane rotation.

Definition at line 201 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
void Teuchos::BLAS< OrdinalType, ScalarType >::SCAL const OrdinalType  n,
const ScalarType  alpha,
ScalarType *  x,
const OrdinalType  incx
const
 

Scale the vector x by the constant alpha.

Definition at line 228 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
void Teuchos::BLAS< OrdinalType, ScalarType >::COPY const OrdinalType  n,
const ScalarType *  x,
const OrdinalType  incx,
ScalarType *  y,
const OrdinalType  incy
const
 

Copy the vector x to the vector y.

Definition at line 246 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
void Teuchos::BLAS< OrdinalType, ScalarType >::AXPY const OrdinalType  n,
const ScalarType  alpha,
const ScalarType *  x,
const OrdinalType  incx,
ScalarType *  y,
const OrdinalType  incy
const
 

Perform the operation: y <- y+alpha*x.

Definition at line 266 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
ScalarType Teuchos::BLAS< OrdinalType, ScalarType >::ASUM const OrdinalType  n,
const ScalarType *  x,
const OrdinalType  incx
const
 

Sum the absolute values of the entries of x.

Definition at line 287 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
ScalarType Teuchos::BLAS< OrdinalType, ScalarType >::DOT const OrdinalType  n,
const ScalarType *  x,
const OrdinalType  incx,
const ScalarType *  y,
const OrdinalType  incy
const
 

Form the dot product of the vectors x and y.

Definition at line 307 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
ScalarType Teuchos::BLAS< OrdinalType, ScalarType >::NRM2 const OrdinalType  n,
const ScalarType *  x,
const OrdinalType  incx
const
 

Compute the 2-norm of the vector x.

Definition at line 330 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
OrdinalType Teuchos::BLAS< OrdinalType, ScalarType >::IAMAX const OrdinalType  n,
const ScalarType *  x,
const OrdinalType  incx
const
 

Return the index of the element of x with the maximum magnitude.

Definition at line 352 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
void Teuchos::BLAS< OrdinalType, ScalarType >::GEMV ETransp  trans,
const OrdinalType  m,
const OrdinalType  n,
const ScalarType  alpha,
const ScalarType *  A,
const OrdinalType  lda,
const ScalarType *  x,
const OrdinalType  incx,
const ScalarType  beta,
ScalarType *  y,
const OrdinalType  incy
const
 

Performs the matrix-vector operation: y <- alpha*A*x+beta*y or y <- alpha*A'*x+beta*y where A is a general m by n matrix.

Definition at line 382 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
void Teuchos::BLAS< OrdinalType, ScalarType >::TRMV EUplo  uplo,
ETransp  trans,
EDiag  diag,
const OrdinalType  n,
const ScalarType *  A,
const OrdinalType  lda,
ScalarType *  x,
const OrdinalType  incx
const
 

Performs the matrix-vector operation: x <- A*x or x <- A'*x where A is a unit/non-unit n by n upper/lower triangular matrix.

Definition at line 514 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
void Teuchos::BLAS< OrdinalType, ScalarType >::GER const OrdinalType  m,
const OrdinalType  n,
const ScalarType  alpha,
const ScalarType *  x,
const OrdinalType  incx,
const ScalarType *  y,
const OrdinalType  incy,
ScalarType *  A,
const OrdinalType  lda
const
 

Performs the rank 1 operation: A <- alpha*x*y'+A.

Definition at line 671 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
void Teuchos::BLAS< OrdinalType, ScalarType >::GEMM ETransp  transa,
ETransp  transb,
const OrdinalType  m,
const OrdinalType  n,
const OrdinalType  k,
const ScalarType  alpha,
const ScalarType *  A,
const OrdinalType  lda,
const ScalarType *  B,
const OrdinalType  ldb,
const ScalarType  beta,
ScalarType *  C,
const OrdinalType  ldc
const
 

Performs the matrix-matrix operation: C <- alpha*op(A)*op(B)+beta*C where op(A) is either A or A', op(B) is either B or B', and C is an m by k matrix.

Definition at line 745 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
void Teuchos::BLAS< OrdinalType, ScalarType >::SYMM ESide  side,
EUplo  uplo,
const OrdinalType  m,
const OrdinalType  n,
const ScalarType  alpha,
const ScalarType *  A,
const OrdinalType  lda,
const ScalarType *  B,
const OrdinalType  ldb,
const ScalarType  beta,
ScalarType *  C,
const OrdinalType  ldc
const
 

Performs the matrix-matrix operation: C <- alpha*A*B+beta*C or C <- alpha*B*A+beta*C where A is an m by m or n by n symmetric matrix and B is a general matrix.

Definition at line 894 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
void Teuchos::BLAS< OrdinalType, ScalarType >::TRMM ESide  side,
EUplo  uplo,
ETransp  transa,
EDiag  diag,
const OrdinalType  m,
const OrdinalType  n,
const ScalarType  alpha,
const ScalarType *  A,
const OrdinalType  lda,
ScalarType *  B,
const OrdinalType  ldb
const
 

Performs the matrix-matrix operation: C <- alpha*op(A)*B+beta*C or C <- alpha*B*op(A)+beta*C where op(A) is an unit/non-unit, upper/lower triangular matrix and B is a general matrix.

Definition at line 1021 of file Teuchos_BLAS.hpp.

template<typename OrdinalType, typename ScalarType>
void Teuchos::BLAS< OrdinalType, ScalarType >::TRSM ESide  side,
EUplo  uplo,
ETransp  transa,
EDiag  diag,
const OrdinalType  m,
const OrdinalType  n,
const ScalarType  alpha,
const ScalarType *  A,
const OrdinalType  lda,
ScalarType *  B,
const OrdinalType  ldb
const
 

Solves the matrix equations: op(A)*X=alpha*B or X*op(A)=alpha*B where X and B are m by n matrices, A is a unit/non-unit, upper/lower triangular matrix and op(A) is A or A'. The matrix X is overwritten on B.

Definition at line 1220 of file Teuchos_BLAS.hpp.


The documentation for this class was generated from the following file:
Generated on Thu Sep 18 12:41:20 2008 for Teuchos - Trilinos Tools Package by doxygen 1.3.9.1