Loading...
Searching...
No Matches
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.
 
static void Set (const VectorType &v, VectorType *result)
 Copies entire element of given vector result with other vector v.
 
static void Set (ScalarType s, MatrixType *result)
 Sets entire element of given matrix result with scalar s.
 
static void Set (const MatrixType &m, MatrixType *result)
 Copies entire element of given matrix result with other matrix v.
 
static ScalarType Dot (const VectorType &a, const VectorType &b)
 Performs dot product with vector a and b.
 
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.
 
static void Residual (const MatrixType &a, const VectorType &x, const VectorType &b, VectorType *result)
 Computes residual vector (b - ax).
 
static ScalarType L2Norm (const VectorType &v)
 Returns L2-norm of the given vector v.
 
static ScalarType LInfNorm (const VectorType &v)
 Returns L-inf-norm of the given vector v.
 

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()

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

◆ Dot()

Performs dot product with vector a and b.

◆ L2Norm()

Returns L2-norm of the given vector v.

◆ LInfNorm()

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

◆ MVM()

Performs matrix-vector multiplication.

◆ Residual()

Computes residual vector (b - ax).

◆ Set() [1/4]

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

◆ Set() [2/4]

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

◆ Set() [3/4]

Sets entire element of given matrix result with scalar s.

◆ Set() [4/4]

Sets entire element of given vector result with scalar s.


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