Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members
Teuchos::DefaultBLASImpl< OrdinalType, ScalarType > Class Template Reference

Default implementation for BLAS routines. More...

#include <Teuchos_BLAS.hpp>

Inheritance diagram for Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >:
Teuchos::BLAS< OrdinalType, ScalarType > Teuchos::SerialBandDenseMatrix< OrdinalType, ScalarType > Teuchos::SerialBandDenseSolver< OrdinalType, ScalarType > Teuchos::SerialDenseMatrix< OrdinalType, ScalarType > Teuchos::SerialDenseSolver< OrdinalType, ScalarType > Teuchos::SerialQRDenseSolver< OrdinalType, ScalarType > Teuchos::SerialSpdDenseSolver< OrdinalType, ScalarType > Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType > Teuchos::SerialTriDiMatrix< OrdinalType, ScalarType >

Public Member Functions

Constructor/Destructor.
 DefaultBLASImpl (void)
 Default constructor. More...
 
 DefaultBLASImpl (const DefaultBLASImpl< OrdinalType, ScalarType > &)
 Copy constructor. More...
 
virtual ~DefaultBLASImpl (void)
 Destructor. More...
 
Level 2 BLAS Routines.
template<typename alpha_type , typename A_type , typename x_type , typename beta_type >
void GEMV (ETransp trans, const OrdinalType &m, const OrdinalType &n, const alpha_type alpha, const A_type *A, const OrdinalType &lda, const x_type *x, const OrdinalType &incx, const beta_type 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. More...
 
template<typename A_type >
void TRMV (EUplo uplo, ETransp trans, EDiag diag, const OrdinalType &n, const A_type *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. More...
 
template<typename alpha_type , typename x_type , typename y_type >
void GER (const OrdinalType &m, const OrdinalType &n, const alpha_type alpha, const x_type *x, const OrdinalType &incx, const y_type *y, const OrdinalType &incy, ScalarType *A, const OrdinalType &lda) const
 Performs the rank 1 operation: A <- alpha*x*y'+A. More...
 
Level 3 BLAS Routines.
template<typename alpha_type , typename A_type , typename B_type , typename beta_type >
void GEMM (ETransp transa, ETransp transb, const OrdinalType &m, const OrdinalType &n, const OrdinalType &k, const alpha_type alpha, const A_type *A, const OrdinalType &lda, const B_type *B, const OrdinalType &ldb, const beta_type beta, ScalarType *C, const OrdinalType &ldc) const
 General matrix-matrix multiply. More...
 
void SWAP (const OrdinalType &n, ScalarType *const x, const OrdinalType &incx, ScalarType *const y, const OrdinalType &incy) const
 Swap the entries of x and y. More...
 
template<typename alpha_type , typename A_type , typename B_type , typename beta_type >
void SYMM (ESide side, EUplo uplo, const OrdinalType &m, const OrdinalType &n, const alpha_type alpha, const A_type *A, const OrdinalType &lda, const B_type *B, const OrdinalType &ldb, const beta_type 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. More...
 
template<typename alpha_type , typename A_type , typename beta_type >
void SYRK (EUplo uplo, ETransp trans, const OrdinalType &n, const OrdinalType &k, const alpha_type alpha, const A_type *A, const OrdinalType &lda, const beta_type beta, ScalarType *C, const OrdinalType &ldc) const
 Performs the symmetric rank k operation: C <- alpha*A*A'+beta*C or C <- alpha*A'*A+beta*C, where alpha and beta are scalars, C is an n by n symmetric matrix and A is an n by k matrix in the first case or k by n matrix in the second case. More...
 
template<typename alpha_type , typename A_type >
void TRMM (ESide side, EUplo uplo, ETransp transa, EDiag diag, const OrdinalType &m, const OrdinalType &n, const alpha_type alpha, const A_type *A, const OrdinalType &lda, ScalarType *B, const OrdinalType &ldb) const
 Performs the matrix-matrix operation: B <- alpha*op(A)*B or B <- alpha*B*op(A) where op(A) is an unit/non-unit, upper/lower triangular matrix and B is a general matrix. More...
 
template<typename alpha_type , typename A_type >
void TRSM (ESide side, EUplo uplo, ETransp transa, EDiag diag, const OrdinalType &m, const OrdinalType &n, const alpha_type alpha, const A_type *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. More...
 

Level 1 BLAS Routines.

typedef details::GivensRotator
< ScalarType >::c_type 
rotg_c_type
 The type used for c in ROTG. More...
 
void ROTG (ScalarType *da, ScalarType *db, rotg_c_type *c, ScalarType *s) const
 Computes a Givens plane rotation. More...
 
void ROT (const OrdinalType &n, ScalarType *dx, const OrdinalType &incx, ScalarType *dy, const OrdinalType &incy, MagnitudeType *c, ScalarType *s) const
 Applies a Givens plane rotation. More...
 
void SCAL (const OrdinalType &n, const ScalarType &alpha, ScalarType *x, const OrdinalType &incx) const
 Scale the vector x by the constant alpha. More...
 
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. More...
 
template<typename alpha_type , typename x_type >
void AXPY (const OrdinalType &n, const alpha_type alpha, const x_type *x, const OrdinalType &incx, ScalarType *y, const OrdinalType &incy) const
 Perform the operation: y <- y+alpha*x. More...
 
ScalarTraits< ScalarType >
::magnitudeType 
ASUM (const OrdinalType &n, const ScalarType *x, const OrdinalType &incx) const
 Sum the absolute values of the entries of x. More...
 
template<typename x_type , typename y_type >
ScalarType DOT (const OrdinalType &n, const x_type *x, const OrdinalType &incx, const y_type *y, const OrdinalType &incy) const
 Form the dot product of the vectors x and y. More...
 
ScalarTraits< ScalarType >
::magnitudeType 
NRM2 (const OrdinalType &n, const ScalarType *x, const OrdinalType &incx) const
 Compute the 2-norm of the vector x. More...
 
OrdinalType IAMAX (const OrdinalType &n, const ScalarType *x, const OrdinalType &incx) const
 Return the index of the element of x with the maximum magnitude. More...
 

Detailed Description

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

Default implementation for BLAS routines.

This class provides the default implementation for the BLAS routines. It is put in a separate class so that specializations of BLAS for other types still have this implementation available.

Definition at line 97 of file Teuchos_BLAS.hpp.

Member Typedef Documentation

template<typename OrdinalType , typename ScalarType >
typedef details::GivensRotator<ScalarType>::c_type Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::rotg_c_type

The type used for c in ROTG.

This is MagnitudeType if ScalarType is complex and ScalarType otherwise.

Definition at line 122 of file Teuchos_BLAS.hpp.

Constructor & Destructor Documentation

template<typename OrdinalType , typename ScalarType >
Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::DefaultBLASImpl ( void  )
inline

Default constructor.

Definition at line 107 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::DefaultBLASImpl ( const DefaultBLASImpl< OrdinalType, ScalarType > &  )
inline

Copy constructor.

Definition at line 110 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
virtual Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::~DefaultBLASImpl ( void  )
inlinevirtual

Destructor.

Definition at line 113 of file Teuchos_BLAS.hpp.

Member Function Documentation

template<typename OrdinalType , typename ScalarType >
void Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::ROTG ( ScalarType *  da,
ScalarType *  db,
rotg_c_type c,
ScalarType *  s 
) const

Computes a Givens plane rotation.

Definition at line 485 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
void Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::ROT ( const OrdinalType &  n,
ScalarType *  dx,
const OrdinalType &  incx,
ScalarType *  dy,
const OrdinalType &  incy,
MagnitudeType *  c,
ScalarType *  s 
) const

Applies a Givens plane rotation.

Definition at line 495 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
void Teuchos::DefaultBLASImpl< 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 522 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
void Teuchos::DefaultBLASImpl< 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 540 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
template<typename alpha_type , typename x_type >
void Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::AXPY ( const OrdinalType &  n,
const alpha_type  alpha,
const x_type *  x,
const OrdinalType &  incx,
ScalarType *  y,
const OrdinalType &  incy 
) const

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

Definition at line 561 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
ScalarTraits< ScalarType >::magnitudeType Teuchos::DefaultBLASImpl< 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 582 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
template<typename x_type , typename y_type >
ScalarType Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::DOT ( const OrdinalType &  n,
const x_type *  x,
const OrdinalType &  incx,
const y_type *  y,
const OrdinalType &  incy 
) const

Form the dot product of the vectors x and y.

Definition at line 606 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
ScalarTraits< ScalarType >::magnitudeType Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::NRM2 ( const OrdinalType &  n,
const ScalarType *  x,
const OrdinalType &  incx 
) const

Compute the 2-norm of the vector x.

Definition at line 629 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
OrdinalType Teuchos::DefaultBLASImpl< 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 650 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
template<typename alpha_type , typename A_type , typename x_type , typename beta_type >
void Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::GEMV ( ETransp  trans,
const OrdinalType &  m,
const OrdinalType &  n,
const alpha_type  alpha,
const A_type *  A,
const OrdinalType &  lda,
const x_type *  x,
const OrdinalType &  incx,
const beta_type  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 686 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
template<typename A_type >
void Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::TRMV ( EUplo  uplo,
ETransp  trans,
EDiag  diag,
const OrdinalType &  n,
const A_type *  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 839 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
template<typename alpha_type , typename x_type , typename y_type >
void Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::GER ( const OrdinalType &  m,
const OrdinalType &  n,
const alpha_type  alpha,
const x_type *  x,
const OrdinalType &  incx,
const y_type *  y,
const OrdinalType &  incy,
ScalarType *  A,
const OrdinalType &  lda 
) const

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

Note
For complex arithmetic, this routine performs [Z/C]GERU.

Definition at line 1034 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
template<typename alpha_type , typename A_type , typename B_type , typename beta_type >
void Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::GEMM ( ETransp  transa,
ETransp  transb,
const OrdinalType &  m,
const OrdinalType &  n,
const OrdinalType &  k,
const alpha_type  alpha,
const A_type *  A,
const OrdinalType &  lda,
const B_type *  B,
const OrdinalType &  ldb,
const beta_type  beta,
ScalarType *  C,
const OrdinalType &  ldc 
) const

General matrix-matrix multiply.

This computes C = alpha*op(A)*op(B) + beta*C. op(X) here may be either X, the transpose of X, or the conjugate transpose of X. op(A) has m rows and k columns, op(B) has k rows and n columns, and C has m rows and n columns.

Definition at line 1109 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
void Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::SWAP ( const OrdinalType &  n,
ScalarType *const  x,
const OrdinalType &  incx,
ScalarType *const  y,
const OrdinalType &  incy 
) const

Swap the entries of x and y.

Definition at line 1356 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
template<typename alpha_type , typename A_type , typename B_type , typename beta_type >
void Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::SYMM ( ESide  side,
EUplo  uplo,
const OrdinalType &  m,
const OrdinalType &  n,
const alpha_type  alpha,
const A_type *  A,
const OrdinalType &  lda,
const B_type *  B,
const OrdinalType &  ldb,
const beta_type  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 1393 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
template<typename alpha_type , typename A_type , typename beta_type >
void Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::SYRK ( EUplo  uplo,
ETransp  trans,
const OrdinalType &  n,
const OrdinalType &  k,
const alpha_type  alpha,
const A_type *  A,
const OrdinalType &  lda,
const beta_type  beta,
ScalarType *  C,
const OrdinalType &  ldc 
) const

Performs the symmetric rank k operation: C <- alpha*A*A'+beta*C or C <- alpha*A'*A+beta*C, where alpha and beta are scalars, C is an n by n symmetric matrix and A is an n by k matrix in the first case or k by n matrix in the second case.

Definition at line 1523 of file Teuchos_BLAS.hpp.

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

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

Definition at line 1697 of file Teuchos_BLAS.hpp.

template<typename OrdinalType , typename ScalarType >
template<typename alpha_type , typename A_type >
void Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >::TRSM ( ESide  side,
EUplo  uplo,
ETransp  transa,
EDiag  diag,
const OrdinalType &  m,
const OrdinalType &  n,
const alpha_type  alpha,
const A_type *  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 1930 of file Teuchos_BLAS.hpp.


The documentation for this class was generated from the following file: