3#ifndef DUNE_DYNMATRIX_HH
4#define DUNE_DYNMATRIX_HH
26 template<
class K >
class DynamicMatrix;
29 struct DenseMatVecTraits< DynamicMatrix<K> >
31 typedef DynamicMatrix<K> derived_type;
33 typedef DynamicVector<K> row_type;
35 typedef row_type &row_reference;
36 typedef const row_type &const_row_reference;
38 typedef std::vector<K> container_type;
40 typedef typename container_type::size_type size_type;
44 struct FieldTraits< DynamicMatrix<K> >
46 typedef typename FieldTraits<K>::field_type field_type;
47 typedef typename FieldTraits<K>::real_type real_type;
57 std::vector< DynamicVector<K> > _data;
69 DynamicMatrix (size_type r, size_type c, value_type v = value_type() ) :
74 void resize (size_type r, size_type c, value_type v = value_type() )
77 _data.resize(r, row_type(c, v) );
81 using Base::operator=;
84 size_type mat_rows()
const {
return _data.size(); }
85 size_type mat_cols()
const {
87 return _data.front().size();
89 row_type & mat_access(size_type i) {
return _data[i]; }
90 const row_type & mat_access(size_type i)
const {
return _data[i]; }
A dense n x m matrix.
Definition: densematrix.hh:185
Traits::value_type value_type
export the type representing the field
Definition: densematrix.hh:199
size_type rows() const
number of rows
Definition: densematrix.hh:695
Traits::size_type size_type
The type used for the index access and size operation.
Definition: densematrix.hh:208
Construct a matrix with a dynamic size.
Definition: dynmatrix.hh:56
DynamicMatrix()
Default constructor.
Definition: dynmatrix.hh:66
DynamicMatrix(size_type r, size_type c, value_type v=value_type())
Constructor initializing the whole matrix with a scalar.
Definition: dynmatrix.hh:69
Construct a vector with a dynamic size.
Definition: dynvector.hh:55
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:10