Jet  v1.3.3
Public Types | Static Public Member Functions | List of all members
jet::Blas< S, V, M > Struct Template Reference

Generic BLAS operator wrapper class. More...

#include <jet/blas.h>

Public Types

typedef S ScalarType
 
typedef V VectorType
 
typedef M MatrixType
 

Static Public Member Functions

static void set (ScalarType s, VectorType *result)
 Sets entire element of given vector result with scalar s. More...
 
static void set (const VectorType &v, VectorType *result)
 Copies entire element of given vector result with other vector v. More...
 
static void set (ScalarType s, MatrixType *result)
 Sets entire element of given matrix result with scalar s. More...
 
static void set (const MatrixType &m, MatrixType *result)
 Copies entire element of given matrix result with other matrix v. More...
 
static ScalarType dot (const VectorType &a, const VectorType &b)
 Performs dot product with vector a and b. More...
 
static void axpy (ScalarType a, const VectorType &x, const VectorType &y, VectorType *result)
 
static void mvm (const MatrixType &m, const VectorType &v, VectorType *result)
 Performs matrix-vector multiplication. More...
 
static void residual (const MatrixType &a, const VectorType &x, const VectorType &b, VectorType *result)
 Computes residual vector (b - ax). More...
 
static ScalarType l2Norm (const VectorType &v)
 Returns L2-norm of the given vector v. More...
 
static ScalarType lInfNorm (const VectorType &v)
 Returns Linf-norm of the given vector v. More...
 

Detailed Description

template<typename S, typename V, typename M>
struct jet::Blas< S, V, M >

Generic BLAS operator wrapper class.

This class provides BLAS (Basic Linear Algebra Subprograms)-like set of operators for vector and matrix class. By default, it supports Vector<T, 2>, Vector<T, 3>, Vector<T, 4>, Matrix<T, 2, 2>, Matrix<T, 3, 3> and Matrix<T, 4, 4>. For custom vector/matrix classes, create a new BLAS class that conforms the function interfaces defined in this class. It will enable performing linear algebra routines (such as conjugate grapdient) for the custom vector/matrix types.

Member Typedef Documentation

◆ MatrixType

template<typename S , typename V , typename M >
typedef M jet::Blas< S, V, M >::MatrixType

◆ ScalarType

template<typename S , typename V , typename M >
typedef S jet::Blas< S, V, M >::ScalarType

◆ VectorType

template<typename S , typename V , typename M >
typedef V jet::Blas< S, V, M >::VectorType

Member Function Documentation

◆ axpy()

template<typename S , typename V , typename M >
static void jet::Blas< S, V, M >::axpy ( ScalarType  a,
const VectorType x,
const VectorType y,
VectorType result 
)
static

Performs ax + y operation where a is a matrix and x and y are vectors.

◆ dot()

template<typename S , typename V , typename M >
static ScalarType jet::Blas< S, V, M >::dot ( const VectorType a,
const VectorType b 
)
static

Performs dot product with vector a and b.

◆ l2Norm()

template<typename S , typename V , typename M >
static ScalarType jet::Blas< S, V, M >::l2Norm ( const VectorType v)
static

Returns L2-norm of the given vector v.

◆ lInfNorm()

template<typename S , typename V , typename M >
static ScalarType jet::Blas< S, V, M >::lInfNorm ( const VectorType v)
static

Returns Linf-norm of the given vector v.

◆ mvm()

template<typename S , typename V , typename M >
static void jet::Blas< S, V, M >::mvm ( const MatrixType m,
const VectorType v,
VectorType result 
)
static

Performs matrix-vector multiplication.

◆ residual()

template<typename S , typename V , typename M >
static void jet::Blas< S, V, M >::residual ( const MatrixType a,
const VectorType x,
const VectorType b,
VectorType result 
)
static

Computes residual vector (b - ax).

◆ set() [1/4]

template<typename S , typename V , typename M >
static void jet::Blas< S, V, M >::set ( const MatrixType m,
MatrixType result 
)
static

Copies entire element of given matrix result with other matrix v.

◆ set() [2/4]

template<typename S , typename V , typename M >
static void jet::Blas< S, V, M >::set ( const VectorType v,
VectorType result 
)
static

Copies entire element of given vector result with other vector v.

◆ set() [3/4]

template<typename S , typename V , typename M >
static void jet::Blas< S, V, M >::set ( ScalarType  s,
MatrixType result 
)
static

Sets entire element of given matrix result with scalar s.

◆ set() [4/4]

template<typename S , typename V , typename M >
static void jet::Blas< S, V, M >::set ( ScalarType  s,
VectorType result 
)
static

Sets entire element of given vector result with scalar s.


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