4#ifndef DUNE_DYNMATRIX_HH
5#define DUNE_DYNMATRIX_HH
28 template<
class K >
class DynamicMatrix;
31 struct DenseMatVecTraits< DynamicMatrix<K> >
33 typedef DynamicMatrix<K> derived_type;
35 typedef DynamicVector<K> row_type;
37 typedef row_type &row_reference;
38 typedef const row_type &const_row_reference;
40 typedef std::vector<K> container_type;
42 typedef typename container_type::size_type size_type;
46 struct FieldTraits< DynamicMatrix<K> >
48 typedef typename FieldTraits<K>::field_type field_type;
49 typedef typename FieldTraits<K>::real_type real_type;
59 std::vector< DynamicVector<K> > _data;
71 DynamicMatrix (size_type r, size_type c, value_type v = value_type() ) :
76 void resize (size_type r, size_type c, value_type v = value_type() )
79 _data.resize(r, row_type(c, v) );
83 using Base::operator=;
86 size_type mat_rows()
const {
return _data.size(); }
87 size_type mat_cols()
const {
89 return _data.front().size();
91 row_type & mat_access(size_type i) {
return _data[i]; }
92 const row_type & mat_access(size_type i)
const {
return _data[i]; }
A dense n x m matrix.
Definition: densematrix.hh:192
Traits::value_type value_type
export the type representing the field
Definition: densematrix.hh:206
size_type rows() const
number of rows
Definition: densematrix.hh:704
Traits::size_type size_type
The type used for the index access and size operation.
Definition: densematrix.hh:215
Construct a matrix with a dynamic size.
Definition: dynmatrix.hh:58
DynamicMatrix()
Default constructor.
Definition: dynmatrix.hh:68
DynamicMatrix(size_type r, size_type c, value_type v=value_type())
Constructor initializing the whole matrix with a scalar.
Definition: dynmatrix.hh:71
Construct a vector with a dynamic size.
Definition: dynvector.hh:53
Implements a matrix constructed from a given type representing a field and a compile-time given numbe...
A few common exception classes.
This file implements a dense vector with a dynamic size.
Dune namespace.
Definition: alignment.hh:14
Fallback implementation of the C++0x static_assert feature.