Discontinuous Galerkin Library
#include "dg/algorithm.h"
dg::MultiMatrix< MatrixType, ContainerType > Struct Template Reference

Struct that applies given matrices one after the other. More...

Public Types

using real_type = get_value_type< ContainerType >
 

Public Member Functions

 MultiMatrix ()
 
 MultiMatrix (int dimension)
 reserve space for dimension matrices and dimension-1 ContainerTypes More...
 
template<class OtherMatrix , class OtherContainer , class ... Params>
 MultiMatrix (const MultiMatrix< OtherMatrix, OtherContainer > &src, Params &&... ps)
 
template<class ... Params>
void construct (Params &&...ps)
 
template<class ContainerType0 , class ContainerType1 >
void symv (const ContainerType0 &x, ContainerType1 &y) const
 
template<class ContainerType0 , class ContainerType1 >
void symv (real_type alpha, const ContainerType0 &x, real_type beta, ContainerType1 &y) const
 
std::vector< Buffer< ContainerType > > & get_temp ()
 
const std::vector< Buffer< ContainerType > > & get_temp () const
 
std::vector< MatrixType > & get_matrices ()
 
const std::vector< MatrixType > & get_matrices () const
 

Detailed Description

template<class MatrixType, class ContainerType>
struct dg::MultiMatrix< MatrixType, ContainerType >

Struct that applies given matrices one after the other.

\[ y = M_{N-1}(...M_1(M_0x))\]

where \( M_i\) is the i-th matrix

See also
mainly used by dg::create::fast_interpolation and dg::ModalFilter
Template Parameters
MatrixTypeAny class for which a specialization of TensorTraits exists and defines a tensor_category derived from AnyMatrixTag. Furthermore, any functor/lambda type with signature void operator()( const ContainerType0&, ContainerType1&) . For example In case of SelfMadeMatrixTag only those blas2 functions that have a corresponding member function in the Matrix class (e.g. symv( const ContainerType0&, ContainerType1&); ) can be called. If a Container has the RecursiveVectorTag, then the matrix is applied to each of the elements unless the type has the SelfMadeMatrixTag or is a Functor type.
ContainerTypeAny class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag. Among others
  • dg::HVec (serial), dg::DVec (cuda / omp), dg::MHVec (mpi + serial) or dg::MDVec (mpi + cuda / omp)
  • std::vector<dg::DVec> (vector of shared device vectors), std::array<double, 4> (array of 4 doubles) or std::map < std::string, dg::DVec> ( a map of named vectors)
  • double (scalar) and other primitive types ...
If there are several ContainerTypes in the argument list, then TensorTraits must exist for all of them
See also
See The dg dispatch system for a detailed explanation of our type dispatch system

Member Typedef Documentation

◆ real_type

template<class MatrixType , class ContainerType >
using dg::MultiMatrix< MatrixType, ContainerType >::real_type = get_value_type<ContainerType>

Constructor & Destructor Documentation

◆ MultiMatrix() [1/3]

template<class MatrixType , class ContainerType >
dg::MultiMatrix< MatrixType, ContainerType >::MultiMatrix ( )
inline

◆ MultiMatrix() [2/3]

template<class MatrixType , class ContainerType >
dg::MultiMatrix< MatrixType, ContainerType >::MultiMatrix ( int  dimension)
inline

reserve space for dimension matrices and dimension-1 ContainerTypes

Parameters
dimension# of matrices to store
Attention
it is the user's reponsibility to allocate memory for the intermediate "temp" vectors

◆ MultiMatrix() [3/3]

template<class MatrixType , class ContainerType >
template<class OtherMatrix , class OtherContainer , class ... Params>
dg::MultiMatrix< MatrixType, ContainerType >::MultiMatrix ( const MultiMatrix< OtherMatrix, OtherContainer > &  src,
Params &&...  ps 
)
inline

Member Function Documentation

◆ construct()

template<class MatrixType , class ContainerType >
template<class ... Params>
void dg::MultiMatrix< MatrixType, ContainerType >::construct ( Params &&...  ps)
inline

◆ get_matrices() [1/2]

template<class MatrixType , class ContainerType >
std::vector< MatrixType > & dg::MultiMatrix< MatrixType, ContainerType >::get_matrices ( )
inline

◆ get_matrices() [2/2]

template<class MatrixType , class ContainerType >
const std::vector< MatrixType > & dg::MultiMatrix< MatrixType, ContainerType >::get_matrices ( ) const
inline

◆ get_temp() [1/2]

template<class MatrixType , class ContainerType >
std::vector< Buffer< ContainerType > > & dg::MultiMatrix< MatrixType, ContainerType >::get_temp ( )
inline

◆ get_temp() [2/2]

template<class MatrixType , class ContainerType >
const std::vector< Buffer< ContainerType > > & dg::MultiMatrix< MatrixType, ContainerType >::get_temp ( ) const
inline

◆ symv() [1/2]

template<class MatrixType , class ContainerType >
template<class ContainerType0 , class ContainerType1 >
void dg::MultiMatrix< MatrixType, ContainerType >::symv ( const ContainerType0 &  x,
ContainerType1 &  y 
) const
inline

◆ symv() [2/2]

template<class MatrixType , class ContainerType >
template<class ContainerType0 , class ContainerType1 >
void dg::MultiMatrix< MatrixType, ContainerType >::symv ( real_type  alpha,
const ContainerType0 &  x,
real_type  beta,
ContainerType1 &  y 
) const
inline

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