5#ifndef DUNE_DYNMATRIX_HH
6#define DUNE_DYNMATRIX_HH
11#include <initializer_list>
31 template<
class K >
class DynamicMatrix;
45 typedef typename container_type::size_type
size_type;
62 std::vector< DynamicVector<K> > _data;
86 typename = std::enable_if_t<!Dune::IsNumber<T>::value && HasDenseMatrixAssigner<DynamicMatrix, T>::value>>
114 template <
typename T,
115 typename = std::enable_if_t<!Dune::IsNumber<T>::value>>
118 std::fill(_data.begin(), _data.end(),
row_type(rhs.M(), K(0)));
124 template <
typename T,
125 typename = std::enable_if_t<Dune::IsNumber<T>::value>>
127 std::fill(_data.begin(), _data.end(), scalar);
135 for( size_type i = 0; i < this->
N(); ++i )
137 AT[j][i] = (*
this)[i][j];
144 assert(this->
rows());
145 return _data.front().size();
Traits for type conversions and type information.
This file implements a dense vector with a dynamic size.
Implements a matrix constructed from a given type representing a field and a compile-time given numbe...
A few common exception classes.
Macro for wrapping boundary checks.
#define DUNE_ASSERT_BOUNDS(cond)
If DUNE_CHECK_BOUNDS is defined: check if condition cond holds; otherwise, do nothing.
Definition boundschecking.hh:30
Dune namespace.
Definition alignedallocator.hh:13
A dense n x m matrix.
Definition densematrix.hh:140
derived_type & operator=(const RHS &rhs)
Definition densematrix.hh:279
constexpr size_type M() const
number of columns
Definition densematrix.hh:703
Traits::value_type value_type
export the type representing the field
Definition densematrix.hh:157
constexpr size_type rows() const
number of rows
Definition densematrix.hh:709
constexpr size_type N() const
number of rows
Definition densematrix.hh:697
Traits::size_type size_type
The type used for the index access and size operation.
Definition densematrix.hh:166
Construct a matrix with a dynamic size.
Definition dynmatrix.hh:61
size_type mat_cols() const
Definition dynmatrix.hh:143
DynamicMatrix(std::initializer_list< DynamicVector< K > > const &ll)
Constructor initializing the matrix from a list of vector.
Definition dynmatrix.hh:80
Base::row_type row_type
Definition dynmatrix.hh:67
DynamicMatrix transposed() const
Return transposed of the matrix as DynamicMatrix.
Definition dynmatrix.hh:132
Base::value_type value_type
Definition dynmatrix.hh:66
row_type & mat_access(size_type i)
Definition dynmatrix.hh:147
Base::size_type size_type
Definition dynmatrix.hh:65
size_type mat_rows() const
Definition dynmatrix.hh:142
DynamicMatrix(T const &rhs)
Definition dynmatrix.hh:87
const row_type & mat_access(size_type i) const
Definition dynmatrix.hh:151
void resize(size_type r, size_type c, value_type v=value_type())
resize matrix to r × c
Definition dynmatrix.hh:106
DynamicMatrix & operator=(T const &rhs)
Definition dynmatrix.hh:116
DynamicMatrix()
Default constructor.
Definition dynmatrix.hh:71
DynamicMatrix(size_type r, size_type c, value_type v=value_type())
Constructor initializing the whole matrix with a scalar.
Definition dynmatrix.hh:74
DynamicMatrix & operator=(T scalar)
Definition dynmatrix.hh:126
container_type::size_type size_type
Definition dynmatrix.hh:45
DynamicVector< K > row_type
Definition dynmatrix.hh:38
row_type & row_reference
Definition dynmatrix.hh:40
K value_type
Definition dynmatrix.hh:44
DynamicMatrix< K > derived_type
Definition dynmatrix.hh:36
const row_type & const_row_reference
Definition dynmatrix.hh:41
std::vector< K > container_type
Definition dynmatrix.hh:43
FieldTraits< K >::real_type real_type
Definition dynmatrix.hh:52
FieldTraits< K >::field_type field_type
Definition dynmatrix.hh:51
Construct a vector with a dynamic size.
Definition dynvector.hh:59
T field_type
export the type representing the field
Definition ftraits.hh:28
T real_type
export the type representing the real type of the field
Definition ftraits.hh:30
Definition matvectraits.hh:31