19template<
class ContainerType>
22 using container_type = ContainerType;
23 DenseMatrix() =
default;
24 DenseMatrix(
const std::vector<const ContainerType*>& columns) :
25 m_matrix( columns), m_num_cols(columns.size()) {}
26 DenseMatrix(
const std::vector<const ContainerType*>& columns,
unsigned num_cols) :
27 m_matrix( columns), m_num_cols(num_cols) {}
29 unsigned num_cols()
const{
32 const ContainerType * operator[] (
unsigned idx)
const
36 const std::vector<const ContainerType*>& get()
const{
return m_matrix;}
40 const std::vector<const ContainerType*>& m_matrix;
43template <
class Container>
44struct TensorTraits<DenseMatrix<Container> >
74template<
class ContainerType>
78 return DenseMatrix<ContainerType>(in);
86template<
class ContainerType>
87auto asDenseMatrix(
const std::vector<const ContainerType*>& in,
unsigned size)
90 return DenseMatrix<ContainerType>(in, size);
109template<
class ContainerType>
110std::vector<const ContainerType*>
asPointers(
const std::vector<ContainerType>& in)
112 std::vector<const ContainerType*> ptrs( in.size(),
nullptr);
113 for(
unsigned i=0; i<ptrs.size(); i++)
std::vector< const ContainerType * > asPointers(const std::vector< ContainerType > &in)
Convert a vector of vectors to a vector of pointers.
Definition densematrix.h:110
auto asDenseMatrix(const std::vector< const ContainerType * > &in)
Lightweight DenseMatrix for dg::blas2::gemv.
Definition densematrix.h:75
typename TensorTraits< std::decay_t< Vector > >::execution_policy get_execution_policy
Definition tensor_traits.h:49
typename TensorTraits< std::decay_t< Vector > >::value_type get_value_type
Definition tensor_traits.h:45
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
NoPolicyTag execution_policy
Definition tensor_traits.h:41
NotATensorTag tensor_category
Definition tensor_traits.h:40
void value_type
Definition tensor_traits.h:39