15template<
class ContainerType>
18 using container_type = ContainerType;
19 DenseMatrix() =
default;
20 DenseMatrix(
const std::vector<const ContainerType*>& columns) :
21 m_matrix( columns), m_num_cols(columns.size()) {}
22 DenseMatrix(
const std::vector<const ContainerType*>& columns,
unsigned num_cols) :
23 m_matrix( columns), m_num_cols(num_cols) {}
25 unsigned num_cols()
const{
28 const ContainerType * operator[] (
unsigned idx)
const
32 const std::vector<const ContainerType*>& get()
const{
return m_matrix;}
35 const std::vector<const ContainerType*>& m_matrix;
38template <
class Container>
39struct TensorTraits<DenseMatrix<Container> >
69template<
class ContainerType>
72 return DenseMatrix<ContainerType>(in);
78template<
class ContainerType>
79auto asDenseMatrix(
const std::vector<const ContainerType*>& in,
unsigned size)
81 return DenseMatrix<ContainerType>(in, size);
99template<
class ContainerType>
100std::vector<const ContainerType*>
asPointers(
const std::vector<ContainerType>& in)
102 std::vector<const ContainerType*> ptrs( in.size(),
nullptr);
103 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:100
auto asDenseMatrix(const std::vector< const ContainerType * > &in)
Lightweight DenseMatrix for dg::blas2::gemv.
Definition: densematrix.h:70
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
NoPolicyTag execution_policy
Definition: tensor_traits.h:34
NotATensorTag tensor_category
Definition: tensor_traits.h:33
void value_type
Definition: tensor_traits.h:32