CubbyFlow::BLAS< S, V, M > Struct Template Reference

Generic BLAS operator wrapper class. More...

#include <Core/Math/BLAS.hpp>

Public Types

using ScalarType = S
 
using VectorType = V
 
using MatrixType = M
 

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 AXPlusY (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 L-inf-norm of the given vector v. More...
 

Detailed Description

template<typename S, typename V, typename M>
struct CubbyFlow::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 gradient) for the custom vector/matrix types.

Member Typedef Documentation

◆ MatrixType

template<typename S , typename V , typename M >
using CubbyFlow::BLAS< S, V, M >::MatrixType = M

◆ ScalarType

template<typename S , typename V , typename M >
using CubbyFlow::BLAS< S, V, M >::ScalarType = S

◆ VectorType

template<typename S , typename V , typename M >
using CubbyFlow::BLAS< S, V, M >::VectorType = V

Member Function Documentation

◆ AXPlusY()

template<typename ScalarType , typename VectorType , typename MatrixType >
void CubbyFlow::BLAS< ScalarType, VectorType, MatrixType >::AXPlusY ( 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 ScalarType , typename VectorType , typename MatrixType >
ScalarType CubbyFlow::BLAS< ScalarType, VectorType, MatrixType >::Dot ( const VectorType a,
const VectorType b 
)
static

Performs dot product with vector a and b.

◆ L2Norm()

template<typename ScalarType , typename VectorType , typename MatrixType >
ScalarType CubbyFlow::BLAS< ScalarType, VectorType, MatrixType >::L2Norm ( const VectorType v)
static

Returns L2-norm of the given vector v.

◆ LInfNorm()

template<typename ScalarType , typename VectorType , typename MatrixType >
ScalarType CubbyFlow::BLAS< ScalarType, VectorType, MatrixType >::LInfNorm ( const VectorType v)
static

Returns L-inf-norm of the given vector v.

◆ MVM()

template<typename ScalarType , typename VectorType , typename MatrixType >
void CubbyFlow::BLAS< ScalarType, VectorType, MatrixType >::MVM ( const MatrixType m,
const VectorType v,
VectorType result 
)
static

Performs matrix-vector multiplication.

◆ Residual()

template<typename ScalarType , typename VectorType , typename MatrixType >
void CubbyFlow::BLAS< ScalarType, VectorType, MatrixType >::Residual ( const MatrixType a,
const VectorType x,
const VectorType b,
VectorType result 
)
static

Computes residual vector (b - ax).

◆ Set() [1/4]

template<typename ScalarType , typename VectorType , typename MatrixType >
void CubbyFlow::BLAS< ScalarType, VectorType, MatrixType >::Set ( ScalarType  s,
VectorType result 
)
static

Sets entire element of given vector result with scalar s.

◆ Set() [2/4]

template<typename ScalarType , typename VectorType , typename MatrixType >
void CubbyFlow::BLAS< ScalarType, VectorType, MatrixType >::Set ( const VectorType v,
VectorType result 
)
static

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

◆ Set() [3/4]

template<typename ScalarType , typename VectorType , typename MatrixType >
void CubbyFlow::BLAS< ScalarType, VectorType, MatrixType >::Set ( ScalarType  s,
MatrixType result 
)
static

Sets entire element of given matrix result with scalar s.

◆ Set() [4/4]

template<typename ScalarType , typename VectorType , typename MatrixType >
void CubbyFlow::BLAS< ScalarType, VectorType, MatrixType >::Set ( const MatrixType m,
MatrixType result 
)
static

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


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