Loading...
Searching...
No Matches
diagonalmatrix.hh
Go to the documentation of this file.
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
#ifndef DUNE_DIAGONAL_MATRIX_HH
#define DUNE_DIAGONAL_MATRIX_HH
#include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstddef>
#include <initializer_list>
#include <iostream>
#include <memory>
#include <dune/common/boundschecking.hh>
#include <dune/common/densematrix.hh>
#include <dune/common/dynmatrix.hh>
#include <dune/common/exceptions.hh>
#include <dune/common/fmatrix.hh>
#include <dune/common/ftraits.hh>
#include <dune/common/fvector.hh>
#include <dune/common/genericiterator.hh>
#include <dune/common/matrixconcepts.hh>
#include <dune/common/typetraits.hh>
namespace Dune {
template< class K, int n > class DiagonalRowVectorConst;
template< class K, int n > class DiagonalRowVector;
template< class DiagonalMatrixType > class DiagonalMatrixWrapper;
template< class C, class T, class R> class ContainerWrapperIterator;
template<class K, int n>
class DiagonalMatrix
{
template<class, int> friend class DiagonalMatrix;
typedef DiagonalMatrixWrapper< DiagonalMatrix<K,n> > WrapperType;
public:
//===== type definitions and constants
typedef K value_type;
typedef value_type field_type;
typedef K block_type;
typedef std::size_t size_type;
constexpr static int blocklevel = 1;
typedef DiagonalRowVector<K,n> row_type;
typedef row_type reference;
typedef row_type row_reference;
typedef DiagonalRowVectorConst<K,n> const_row_type;
typedef const_row_type const_reference;
typedef const_row_type const_row_reference;
constexpr static int rows = n;
constexpr static int cols = n;
//==== size
static constexpr size_type size ()
{
return rows;
}
//===== constructors
constexpr DiagonalMatrix() = default;
DiagonalMatrix (const K& k)
: diag_(k)
{}
DiagonalMatrix (const FieldVector<K,n>& diag)
: diag_(diag)
{}
DiagonalMatrix (std::initializer_list<K> const &l)
{
std::copy_n(l.begin(), std::min<std::size_t>(rows, l.size()),
diag_.begin());
}
template <class OtherK>
DiagonalMatrix (const DiagonalMatrix<OtherK,n>& other)
: diag_(other.diag_)
{}
DiagonalMatrix& operator= (const K& k)
{
diag_ = k;
return *this;
}
template <class OtherK>
DiagonalMatrix& operator= (const DiagonalMatrix<OtherK,n>& other)
{
diag_ = other.diag_;
return *this;
}
bool identical(const DiagonalMatrix<K,n>& other) const
{
return (this==&other);
}
DiagonalMatrix<K, n> transposed() const
{
return *this;
}
//===== iterator interface to rows of the matrix
typedef ContainerWrapperIterator<const WrapperType, reference, reference> Iterator;
typedef Iterator iterator;
typedef Iterator RowIterator;
typedef typename row_type::Iterator ColIterator;
Iterator begin ()
{
return Iterator(WrapperType(this),0);
}
Iterator end ()
{
return Iterator(WrapperType(this),n);
}
Iterator beforeEnd ()
{
return Iterator(WrapperType(this),n-1);
}
Iterator beforeBegin ()
{
return Iterator(WrapperType(this),-1);
}
typedef ContainerWrapperIterator<const WrapperType, const_reference, const_reference> ConstIterator;
typedef ConstIterator const_iterator;
typedef ConstIterator ConstRowIterator;
typedef typename const_row_type::ConstIterator ConstColIterator;
ConstIterator begin () const
{
return ConstIterator(WrapperType(this),0);
}
ConstIterator end () const
{
return ConstIterator(WrapperType(this),n);
}
ConstIterator beforeEnd() const
{
return ConstIterator(WrapperType(this),n-1);
}
ConstIterator beforeBegin () const
{
return ConstIterator(WrapperType(this),-1);
}
//===== vector space arithmetic
DiagonalMatrix& operator+= (const DiagonalMatrix& y)
{
diag_ += y.diag_;
return *this;
}
DiagonalMatrix& operator-= (const DiagonalMatrix& y)
{
diag_ -= y.diag_;
return *this;
}
DiagonalMatrix& operator+= (const K& k)
{
diag_ += k;
return *this;
}
DiagonalMatrix& operator-= (const K& k)
{
diag_ -= k;
return *this;
}
DiagonalMatrix& operator*= (const K& k)
{
diag_ *= k;
return *this;
}
DiagonalMatrix& operator/= (const K& k)
{
diag_ /= k;
return *this;
}
//===== comparison ops
bool operator==(const DiagonalMatrix& other) const
{
return diag_==other.diagonal();
}
bool operator!=(const DiagonalMatrix& other) const
{
return diag_!=other.diagonal();
}
//===== linear maps
template<class X, class Y>
void mv (const X& x, Y& y) const
{
#ifdef DUNE_FMatrix_WITH_CHECKING
if (x.N()!=M()) DUNE_THROW(FMatrixError,"index out of range");
if (y.N()!=N()) DUNE_THROW(FMatrixError,"index out of range");
#endif
for (size_type i=0; i<n; ++i)
y[i] = diag_[i] * x[i];
}
template<class X, class Y>
void mtv (const X& x, Y& y) const
{
mv(x, y);
}
template<class X, class Y>
void umv (const X& x, Y& y) const
{
#ifdef DUNE_FMatrix_WITH_CHECKING
if (x.N()!=M()) DUNE_THROW(FMatrixError,"index out of range");
if (y.N()!=N()) DUNE_THROW(FMatrixError,"index out of range");
#endif
for (size_type i=0; i<n; ++i)
y[i] += diag_[i] * x[i];
}
template<class X, class Y>
void umtv (const X& x, Y& y) const
{
#ifdef DUNE_FMatrix_WITH_CHECKING
if (x.N()!=N()) DUNE_THROW(FMatrixError,"index out of range");
if (y.N()!=M()) DUNE_THROW(FMatrixError,"index out of range");
#endif
for (size_type i=0; i<n; ++i)
y[i] += diag_[i] * x[i];
}
template<class X, class Y>
void umhv (const X& x, Y& y) const
{
#ifdef DUNE_FMatrix_WITH_CHECKING
if (x.N()!=N()) DUNE_THROW(FMatrixError,"index out of range");
if (y.N()!=M()) DUNE_THROW(FMatrixError,"index out of range");
#endif
for (size_type i=0; i<n; i++)
y[i] += conjugateComplex(diag_[i])*x[i];
}
template<class X, class Y>
void mmv (const X& x, Y& y) const
{
#ifdef DUNE_FMatrix_WITH_CHECKING
if (x.N()!=M()) DUNE_THROW(FMatrixError,"index out of range");
if (y.N()!=N()) DUNE_THROW(FMatrixError,"index out of range");
#endif
for (size_type i=0; i<n; ++i)
y[i] -= diag_[i] * x[i];
}
template<class X, class Y>
void mmtv (const X& x, Y& y) const
{
#ifdef DUNE_FMatrix_WITH_CHECKING
if (x.N()!=N()) DUNE_THROW(FMatrixError,"index out of range");
if (y.N()!=M()) DUNE_THROW(FMatrixError,"index out of range");
#endif
for (size_type i=0; i<n; ++i)
y[i] -= diag_[i] * x[i];
}
template<class X, class Y>
void mmhv (const X& x, Y& y) const
{
#ifdef DUNE_FMatrix_WITH_CHECKING
if (x.N()!=N()) DUNE_THROW(FMatrixError,"index out of range");
if (y.N()!=M()) DUNE_THROW(FMatrixError,"index out of range");
#endif
for (size_type i=0; i<n; i++)
y[i] -= conjugateComplex(diag_[i])*x[i];
}
template<class X, class Y>
void usmv (const typename FieldTraits<Y>::field_type & alpha,
const X& x, Y& y) const
{
#ifdef DUNE_FMatrix_WITH_CHECKING
if (x.N()!=M()) DUNE_THROW(FMatrixError,"index out of range");
if (y.N()!=N()) DUNE_THROW(FMatrixError,"index out of range");
#endif
for (size_type i=0; i<n; i++)
y[i] += alpha * diag_[i] * x[i];
}
template<class X, class Y>
void usmtv (const typename FieldTraits<Y>::field_type & alpha,
const X& x, Y& y) const
{
#ifdef DUNE_FMatrix_WITH_CHECKING
if (x.N()!=N()) DUNE_THROW(FMatrixError,"index out of range");
if (y.N()!=M()) DUNE_THROW(FMatrixError,"index out of range");
#endif
for (size_type i=0; i<n; i++)
y[i] += alpha * diag_[i] * x[i];
}
template<class X, class Y>
void usmhv (const typename FieldTraits<Y>::field_type & alpha,
const X& x, Y& y) const
{
#ifdef DUNE_FMatrix_WITH_CHECKING
if (x.N()!=N()) DUNE_THROW(FMatrixError,"index out of range");
if (y.N()!=M()) DUNE_THROW(FMatrixError,"index out of range");
#endif
for (size_type i=0; i<n; i++)
y[i] += alpha * conjugateComplex(diag_[i]) * x[i];
}
//===== norms
double frobenius_norm () const
{
return diag_.two_norm();
}
double frobenius_norm2 () const
{
return diag_.two_norm2();
}
double infinity_norm () const
{
return diag_.infinity_norm();
}
double infinity_norm_real () const
{
return diag_.infinity_norm_real();
}
//===== solve
template<class V>
void solve (V& x, const V& b) const
{
for (int i=0; i<n; i++)
x[i] = b[i]/diag_[i];
}
void invert()
{
using real_type = typename FieldTraits<K>::real_type;
for (int i=0; i<n; i++)
diag_[i] = real_type(1.0)/diag_[i];
}
K determinant () const
{
K det = diag_[0];
for (int i=1; i<n; i++)
det *= diag_[i];
return det;
}
//===== matrix-matrix multiplication
template <class OtherScalar>
friend auto operator* ( const DiagonalMatrix& matrixA,
const DiagonalMatrix<OtherScalar, n>& matrixB)
{
auto result = DiagonalMatrix<typename PromotionTraits<K,OtherScalar>::PromotedType, n>{};
for(int i=0; i<n; ++i)
result.diagonal(i) = matrixA.diagonal(i)*matrixB.diagonal(i);
return result;
}
template <class OtherMatrix,
std::enable_if_t<(Impl::IsDenseMatrix<OtherMatrix>::value), int> = 0,
std::enable_if_t<(not Impl::IsFieldMatrix<OtherMatrix>::value), int> = 0>
friend auto operator* ( const DiagonalMatrix& matrixA,
const OtherMatrix& matrixB)
{
using OtherField = typename FieldTraits<OtherMatrix>::field_type;
using F = typename PromotionTraits<field_type, OtherField>::PromotedType;
auto result = [&]{
if constexpr (Impl::IsStaticSizeMatrix_v<OtherMatrix>) {
static_assert(n == OtherMatrix::rows);
return FieldMatrix<F, n, OtherMatrix::cols>{};
} else {
assert(n == matrixB.N());
return DynamicMatrix<F>{n,matrixB.M()};
}
}();
for (int i = 0; i < result.N(); ++i)
for (int j = 0; j < result.M(); ++j)
result[i][j] = matrixA.diagonal(i) * matrixB[i][j];
return result;
}
//===== sizes
static constexpr size_type N ()
{
return n;
}
static constexpr size_type M ()
{
return n;
}
//===== query
bool exists (size_type i, size_type j) const
{
DUNE_ASSERT_BOUNDS(i >= 0 && i < n);
DUNE_ASSERT_BOUNDS(j >= 0 && j < n);
return i==j;
}
friend std::ostream& operator<< (std::ostream& s, const DiagonalMatrix<K,n>& a)
{
for (size_type i=0; i<n; i++) {
for (size_type j=0; j<n; j++)
s << ((i==j) ? a.diag_[i] : 0) << " ";
s << std::endl;
}
return s;
}
reference operator[](size_type i)
{
return reference(const_cast<K*>(&diag_[i]), i);
}
const_reference operator[](size_type i) const
{
return const_reference(const_cast<K*>(&diag_[i]), i);
}
const K& diagonal(size_type i) const
{
return diag_[i];
}
K& diagonal(size_type i)
{
return diag_[i];
}
const FieldVector<K,n>& diagonal() const
{
return diag_;
}
FieldVector<K,n>& diagonal()
{
return diag_;
}
private:
// the data, a FieldVector storing the diagonal
FieldVector<K,n> diag_;
};
template< class K, int n >
struct FieldTraits< DiagonalMatrix<K,n> >
{
typedef typename FieldTraits<K>::field_type field_type;
typedef typename FieldTraits<K>::real_type real_type;
};
#ifndef DOXYGEN // hide specialization
template< class K >
class DiagonalMatrix<K, 1> : public FieldMatrix<K, 1, 1>
{
typedef FieldMatrix<K,1,1> Base;
public:
typedef typename Base::size_type size_type;
constexpr static int blocklevel = 1;
typedef typename Base::row_type row_type;
typedef typename Base::row_reference row_reference;
typedef typename Base::const_row_reference const_row_reference;
constexpr static int rows = 1;
constexpr static int cols = 1;
constexpr DiagonalMatrix() = default;
DiagonalMatrix(const K& scalar)
{
(*this)[0][0] = scalar;
}
template <class OtherK>
DiagonalMatrix(const DiagonalMatrix<OtherK,1>& other)
: Base(FieldMatrix<OtherK,1,1>(other))
{}
const K& diagonal(size_type) const
{
return (*this)[0][0];
}
K& diagonal(size_type)
{
return (*this)[0][0];
}
const FieldVector<K,1>& diagonal() const
{
return (*this)[0];
}
FieldVector<K,1>& diagonal()
{
return (*this)[0];
}
DiagonalMatrix<K, 1> transposed() const
{
return *this;
}
template <class OtherScalar>
friend auto operator* ( const DiagonalMatrix& matrixA,
const DiagonalMatrix<OtherScalar, 1>& matrixB)
{
return DiagonalMatrix<typename PromotionTraits<K,OtherScalar>::PromotedType, 1>{matrixA.diagonal(0)*matrixB.diagonal(0)};
}
template <class OtherMatrix,
std::enable_if_t<(Impl::IsDenseMatrix<OtherMatrix>::value), int> = 0,
std::enable_if_t<(not Impl::IsFieldMatrix<OtherMatrix>::value), int> = 0>
friend auto operator* ( const DiagonalMatrix& matrixA,
const OtherMatrix& matrixB)
{
using OtherField = typename FieldTraits<OtherMatrix>::field_type;
using F = typename PromotionTraits<K, OtherField>::PromotedType;
auto result = [&]{
if constexpr (Impl::IsStaticSizeMatrix_v<OtherMatrix>) {
static_assert(1 == OtherMatrix::rows);
return FieldMatrix<F, 1, OtherMatrix::cols>{};
} else {
assert(1 == matrixB.N());
return DynamicMatrix<F>{1,matrixB.M()};
}
}();
for (int i = 0; i < result.N(); ++i)
for (int j = 0; j < result.M(); ++j)
result[i][j] = matrixA.diagonal(i) * matrixB[i][j];
return result;
}
};
#endif
template<class DiagonalMatrixType>
class DiagonalMatrixWrapper
{
typedef typename DiagonalMatrixType::reference reference;
typedef typename DiagonalMatrixType::const_reference const_reference;
typedef typename DiagonalMatrixType::field_type K;
typedef DiagonalRowVector<K, DiagonalMatrixType::rows> row_type;
typedef std::size_t size_type;
typedef DiagonalMatrixWrapper< DiagonalMatrixType> MyType;
friend class ContainerWrapperIterator<const MyType, reference, reference>;
friend class ContainerWrapperIterator<const MyType, const_reference, const_reference>;
public:
DiagonalMatrixWrapper() :
mat_(0)
{}
DiagonalMatrixWrapper(const DiagonalMatrixType* mat) :
mat_(const_cast<DiagonalMatrixType*>(mat))
{}
size_type realIndex(int i) const
{
return i;
}
row_type* pointer(int i) const
{
row_ = row_type(&(mat_->diagonal(i)), i);
return &row_;
}
bool identical(const DiagonalMatrixWrapper& other) const
{
return mat_==other.mat_;
}
private:
mutable DiagonalMatrixType* mat_;
mutable row_type row_;
};
template< class K, int n >
class DiagonalRowVectorConst
{
template<class DiagonalMatrixType>
friend class DiagonalMatrixWrapper;
friend class ContainerWrapperIterator<DiagonalRowVectorConst<K,n>, const K, const K&>;
public:
// remember size of vector
constexpr static int dimension = n;
// standard constructor and everything is sufficient ...
//===== type definitions and constants
typedef K field_type;
typedef K block_type;
typedef std::size_t size_type;
constexpr static int blocklevel = 1;
constexpr static int size = n;
DiagonalRowVectorConst() :
p_(0),
row_(0)
{}
explicit DiagonalRowVectorConst (K* p, int col) :
p_(p),
row_(col)
{}
//===== access to components
const K& operator[] ([[maybe_unused]] size_type i) const
{
DUNE_ASSERT_BOUNDS(i == row_);
return *p_;
}
// check if row is identical to other row (not only identical values)
// since this is a proxy class we need to check equality of the stored pointer
bool identical(const DiagonalRowVectorConst<K,n>& other) const
{
return ((p_ == other.p_)and (row_ == other.row_));
}
typedef ContainerWrapperIterator<DiagonalRowVectorConst<K,n>, const K, const K&> ConstIterator;
typedef ConstIterator const_iterator;
ConstIterator begin () const
{
return ConstIterator(*this,0);
}
ConstIterator end () const
{
return ConstIterator(*this,1);
}
ConstIterator beforeEnd() const
{
return ConstIterator(*this,0);
}
ConstIterator beforeBegin () const
{
return ConstIterator(*this,-1);
}
bool operator== (const DiagonalRowVectorConst& y) const
{
return ((p_==y.p_)and (row_==y.row_));
}
//===== sizes
size_type N () const
{
return n;
}
size_type dim () const
{
return n;
}
size_type rowIndex() const
{
return row_;
}
const K& diagonal() const
{
return *p_;
}
protected:
size_type realIndex([[maybe_unused]] int i) const
{
return rowIndex();
}
K* pointer([[maybe_unused]] size_type i) const
{
return const_cast<K*>(p_);
}
DiagonalRowVectorConst* operator&()
{
return this;
}
// the data, very simply a pointer to the diagonal value and the row number
K* p_;
size_type row_;
};
template< class K, int n >
class DiagonalRowVector : public DiagonalRowVectorConst<K,n>
{
template<class DiagonalMatrixType>
friend class DiagonalMatrixWrapper;
friend class ContainerWrapperIterator<DiagonalRowVector<K,n>, K, K&>;
public:
// standard constructor and everything is sufficient ...
//===== type definitions and constants
typedef K field_type;
typedef K block_type;
typedef std::size_t size_type;
DiagonalRowVector() : DiagonalRowVectorConst<K,n>()
{}
explicit DiagonalRowVector (K* p, int col) : DiagonalRowVectorConst<K,n>(p, col)
{}
//===== assignment from scalar
DiagonalRowVector& operator= (const K& k)
{
*p_ = k;
return *this;
}
//===== access to components
K& operator[] ([[maybe_unused]] size_type i)
{
DUNE_ASSERT_BOUNDS(i == row_);
return *p_;
}
typedef ContainerWrapperIterator<DiagonalRowVector<K,n>, K, K&> Iterator;
typedef Iterator iterator;
Iterator begin ()
{
return Iterator(*this, 0);
}
Iterator end ()
{
return Iterator(*this, 1);
}
Iterator beforeEnd ()
{
return Iterator(*this, 0);
}
Iterator beforeBegin ()
{
return Iterator(*this, -1);
}
typedef ContainerWrapperIterator<DiagonalRowVectorConst<K,n>, const K, const K&> ConstIterator;
typedef ConstIterator const_iterator;
using DiagonalRowVectorConst<K,n>::identical;
using DiagonalRowVectorConst<K,n>::operator[];
using DiagonalRowVectorConst<K,n>::operator==;
using DiagonalRowVectorConst<K,n>::begin;
using DiagonalRowVectorConst<K,n>::end;
using DiagonalRowVectorConst<K,n>::beforeEnd;
using DiagonalRowVectorConst<K,n>::beforeBegin;
using DiagonalRowVectorConst<K,n>::N;
using DiagonalRowVectorConst<K,n>::dim;
using DiagonalRowVectorConst<K,n>::rowIndex;
using DiagonalRowVectorConst<K,n>::diagonal;
protected:
DiagonalRowVector* operator&()
{
return this;
}
private:
using DiagonalRowVectorConst<K,n>::p_;
using DiagonalRowVectorConst<K,n>::row_;
};
// implement type traits
template<class K, int n>
struct const_reference< DiagonalRowVector<K,n> >
{
typedef DiagonalRowVectorConst<K,n> type;
};
template<class K, int n>
struct const_reference< DiagonalRowVectorConst<K,n> >
{
typedef DiagonalRowVectorConst<K,n> type;
};
template<class K, int n>
struct mutable_reference< DiagonalRowVector<K,n> >
{
typedef DiagonalRowVector<K,n> type;
};
template<class K, int n>
struct mutable_reference< DiagonalRowVectorConst<K,n> >
{
typedef DiagonalRowVector<K,n> type;
};
template<class CW, class T, class R>
class ContainerWrapperIterator : public BidirectionalIteratorFacade<ContainerWrapperIterator<CW,T,R>,T, R, int>
{
typedef typename std::remove_const<CW>::type NonConstCW;
friend class ContainerWrapperIterator<CW, typename mutable_reference<T>::type, typename mutable_reference<R>::type>;
friend class ContainerWrapperIterator<CW, typename const_reference<T>::type, typename const_reference<R>::type>;
typedef ContainerWrapperIterator<CW, typename mutable_reference<T>::type, typename mutable_reference<R>::type> MyType;
typedef ContainerWrapperIterator<CW, typename const_reference<T>::type, typename const_reference<R>::type> MyConstType;
public:
// Constructors needed by the facade iterators.
ContainerWrapperIterator() :
containerWrapper_(),
position_(0)
{}
ContainerWrapperIterator(CW containerWrapper, int position) :
containerWrapper_(containerWrapper),
position_(position)
{}
template<class OtherContainerWrapperIteratorType>
ContainerWrapperIterator(OtherContainerWrapperIteratorType& other) :
containerWrapper_(other.containerWrapper_),
position_(other.position_)
{}
ContainerWrapperIterator(const MyType& other) :
containerWrapper_(other.containerWrapper_),
position_(other.position_)
{}
ContainerWrapperIterator(const MyConstType& other) :
containerWrapper_(other.containerWrapper_),
position_(other.position_)
{}
template<class OtherContainerWrapperIteratorType>
ContainerWrapperIterator& operator=(OtherContainerWrapperIteratorType& other)
{
containerWrapper_ = other.containerWrapper_;
position_ = other.position_;
return *this;
}
// This operator is needed since we can not get the address of the
// temporary object returned by dereference
T* operator->() const
{
return containerWrapper_.pointer(position_);
}
// Methods needed by the forward iterator
bool equals(const MyType& other) const
{
return position_ == other.position_ && containerWrapper_.identical(other.containerWrapper_);
}
bool equals(const MyConstType& other) const
{
return position_ == other.position_ && containerWrapper_.identical(other.containerWrapper_);
}
R dereference() const
{
return *containerWrapper_.pointer(position_);
}
void increment()
{
++position_;
}
// Additional function needed by BidirectionalIterator
void decrement()
{
--position_;
}
// Additional function needed by RandomAccessIterator
R elementAt(int i) const
{
return *containerWrapper_.pointer(position_+i);
}
void advance(int n)
{
position_=position_+n;
}
template<class OtherContainerWrapperIteratorType>
std::ptrdiff_t distanceTo(OtherContainerWrapperIteratorType& other) const
{
assert(containerWrapper_.identical(other));
return other.position_ - position_;
}
std::ptrdiff_t index() const
{
return containerWrapper_.realIndex(position_);
}
private:
NonConstCW containerWrapper_;
size_t position_;
};
template <class DenseMatrix, class field, int N>
struct DenseMatrixAssigner<DenseMatrix, DiagonalMatrix<field, N>> {
static void apply(DenseMatrix& denseMatrix,
DiagonalMatrix<field, N> const& rhs) {
#ifdef DUNE_CHECK_BOUNDS
if (denseMatrix.M() != N || denseMatrix.N() != N)
DUNE_THROW(Dune::RangeError, "Incompatible matrix dimensions in assignment.");
#endif // DUNE_CHECK_BOUNDS
denseMatrix = field(0);
for (int i = 0; i < N; ++i)
denseMatrix[i][i] = rhs.diagonal()[i];
}
};
/* @} */
} // end namespace
#endif
typetraits.hh
Traits for type conversions and type information.
exceptions.hh
A few common exception classes.
ftraits.hh
Type traits to determine the type of reals (when working with complex numbers).
dynmatrix.hh
This file implements a dense matrix with dynamic numbers of rows and columns.
densematrix.hh
Implements a matrix constructed from a given type representing a field and a compile-time given numbe...
boundschecking.hh
Macro for wrapping boundary checks.
genericiterator.hh
Implements a generic iterator class for writing stl conformant iterators.
matrixconcepts.hh
fmatrix.hh
Implements a matrix constructed from a given type representing a field and compile-time given number ...
fvector.hh
Implements a vector constructed from a given type representing a field and a compile-time given size.
DUNE_ASSERT_BOUNDS
#define DUNE_ASSERT_BOUNDS(cond)
If DUNE_CHECK_BOUNDS is defined: check if condition cond holds; otherwise, do nothing.
Definition boundschecking.hh:30
Dune::DiagonalMatrix::DiagonalMatrix
friend class DiagonalMatrix
Definition diagonalmatrix.hh:57
Dune::DiagonalMatrix::beforeBegin
ConstIterator beforeBegin() const
Definition diagonalmatrix.hh:225
Dune::DiagonalMatrix::transposed
DiagonalMatrix< K, n > transposed() const
Return transposed of the matrix as DiagonalMatrix.
Definition diagonalmatrix.hh:153
Dune::DiagonalMatrix::mmhv
void mmhv(const X &x, Y &y) const
y -= A^H x
Definition diagonalmatrix.hh:374
Dune::DiagonalMatrix::operator*=
DiagonalMatrix & operator*=(const K &k)
vector space multiplication with scalar
Definition diagonalmatrix.hh:263
Dune::FieldTraits< DiagonalMatrix< K, n > >::field_type
FieldTraits< K >::field_type field_type
Definition diagonalmatrix.hh:612
Dune::DiagonalMatrix::size_type
std::size_t size_type
The type used for the index access and size operations.
Definition diagonalmatrix.hh:71
Dune::DiagonalRowVectorConst::dim
size_type dim() const
dimension of the vector space
Definition diagonalmatrix.hh:880
Dune::DiagonalMatrix::ConstRowIterator
ConstIterator ConstRowIterator
rename the iterators for easier access
Definition diagonalmatrix.hh:200
Dune::DiagonalMatrix::row_reference
row_type row_reference
Definition diagonalmatrix.hh:79
Dune::DiagonalRowVector::operator[]
K & operator[](size_type i)
random access
Definition diagonalmatrix.hh:959
Dune::ContainerWrapperIterator::operator=
ContainerWrapperIterator & operator=(OtherContainerWrapperIteratorType &other)
Definition diagonalmatrix.hh:1117
Dune::DiagonalMatrix::rows
static constexpr int rows
The number of rows.
Definition diagonalmatrix.hh:85
Dune::DiagonalMatrix::M
static constexpr size_type M()
number of blocks in column direction
Definition diagonalmatrix.hh:537
Dune::DiagonalMatrix::diagonal
FieldVector< K, n > & diagonal()
Get reference to diagonal vector.
Definition diagonalmatrix.hh:598
Dune::DiagonalMatrix::usmhv
void usmhv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A^H x
Definition diagonalmatrix.hh:412
Dune::DiagonalRowVector< K, DiagonalMatrixType::rows >::iterator
Iterator iterator
Definition diagonalmatrix.hh:968
Dune::ContainerWrapperIterator::increment
void increment()
Definition diagonalmatrix.hh:1147
Dune::DiagonalMatrix::blocklevel
static constexpr int blocklevel
The number of block levels we contain. This is the leaf, that is, 1.
Definition diagonalmatrix.hh:74
Dune::const_reference< DiagonalRowVectorConst< K, n > >::type
DiagonalRowVectorConst< K, n > type
Definition diagonalmatrix.hh:1037
Dune::ContainerWrapperIterator::operator->
T * operator->() const
Definition diagonalmatrix.hh:1126
Dune::DiagonalRowVectorConst::size
static constexpr int size
The size of this vector.
Definition diagonalmatrix.hh:804
Dune::DiagonalRowVectorConst::pointer
K * pointer(size_type i) const
Definition diagonalmatrix.hh:904
Dune::DiagonalRowVectorConst::field_type
K field_type
export the type representing the field
Definition diagonalmatrix.hh:792
Dune::mutable_reference< DiagonalRowVector< K, n > >::type
DiagonalRowVector< K, n > type
Definition diagonalmatrix.hh:1043
Dune::DiagonalRowVectorConst::beforeEnd
ConstIterator beforeEnd() const
Definition diagonalmatrix.hh:853
Dune::DiagonalMatrix::ConstColIterator
const_row_type::ConstIterator ConstColIterator
rename the iterators for easier access
Definition diagonalmatrix.hh:202
Dune::DiagonalMatrix::exists
bool exists(size_type i, size_type j) const
return true when (i,j) is in pattern
Definition diagonalmatrix.hh:547
Dune::DiagonalMatrix::ConstIterator
ContainerWrapperIterator< const WrapperType, const_reference, const_reference > ConstIterator
Iterator class for sequential access.
Definition diagonalmatrix.hh:196
Dune::DiagonalMatrix::const_row_reference
const_row_type const_row_reference
Definition diagonalmatrix.hh:82
Dune::DiagonalMatrix::size
static constexpr size_type size()
Definition diagonalmatrix.hh:91
Dune::DiagonalRowVectorConst::row_
size_type row_
Definition diagonalmatrix.hh:916
Dune::ContainerWrapperIterator::ContainerWrapperIterator
ContainerWrapperIterator(CW containerWrapper, int position)
Definition diagonalmatrix.hh:1095
Dune::DiagonalRowVector::DiagonalRowVector
DiagonalRowVector(K *p, int col)
Constructor making vector with identical coordinates.
Definition diagonalmatrix.hh:945
Dune::DiagonalMatrix::diagonal
K & diagonal(size_type i)
Get reference to diagonal entry.
Definition diagonalmatrix.hh:586
Dune::DiagonalMatrix::solve
void solve(V &x, const V &b) const
Solve system A x = b.
Definition diagonalmatrix.hh:455
Dune::DiagonalMatrix::N
static constexpr size_type N()
number of blocks in row direction
Definition diagonalmatrix.hh:531
Dune::DiagonalRowVector::beforeBegin
Iterator beforeBegin()
Definition diagonalmatrix.hh:991
Dune::ContainerWrapperIterator::ContainerWrapperIterator
ContainerWrapperIterator(OtherContainerWrapperIteratorType &other)
Definition diagonalmatrix.hh:1101
Dune::DiagonalMatrix::operator[]
const_reference operator[](size_type i) const
Return const_reference object as row replacement.
Definition diagonalmatrix.hh:574
Dune::DiagonalMatrix::iterator
Iterator iterator
typedef for stl compliant access
Definition diagonalmatrix.hh:162
Dune::DiagonalRowVectorConst::begin
ConstIterator begin() const
begin ConstIterator
Definition diagonalmatrix.hh:840
Dune::DiagonalRowVector< K, DiagonalMatrixType::rows >::const_iterator
ConstIterator const_iterator
Definition diagonalmatrix.hh:999
Dune::DiagonalRowVectorConst::identical
bool identical(const DiagonalRowVectorConst< K, n > &other) const
Definition diagonalmatrix.hh:829
Dune::DiagonalMatrix::operator-=
DiagonalMatrix & operator-=(const DiagonalMatrix &y)
vector space subtraction
Definition diagonalmatrix.hh:242
Dune::DiagonalRowVectorConst::DiagonalRowVectorConst
DiagonalRowVectorConst(K *p, int col)
Constructor making vector with identical coordinates.
Definition diagonalmatrix.hh:813
Dune::DiagonalMatrix::mmtv
void mmtv(const X &x, Y &y) const
y -= A^T x
Definition diagonalmatrix.hh:362
Dune::DiagonalRowVectorConst::blocklevel
static constexpr int blocklevel
The number of block levels we contain.
Definition diagonalmatrix.hh:801
Dune::DiagonalMatrixWrapper::pointer
row_type * pointer(int i) const
Definition diagonalmatrix.hh:756
Dune::DiagonalMatrix::DiagonalMatrix
DiagonalMatrix(const K &k)
Constructor initializing the whole matrix with a scalar.
Definition diagonalmatrix.hh:102
Dune::DiagonalRowVector::Iterator
ContainerWrapperIterator< DiagonalRowVector< K, n >, K, K & > Iterator
Iterator class for sequential access.
Definition diagonalmatrix.hh:966
Dune::ContainerWrapperIterator::elementAt
R elementAt(int i) const
Definition diagonalmatrix.hh:1159
Dune::ContainerWrapperIterator::distanceTo
std::ptrdiff_t distanceTo(OtherContainerWrapperIteratorType &other) const
Definition diagonalmatrix.hh:1170
Dune::DiagonalRowVector::beforeEnd
Iterator beforeEnd()
Definition diagonalmatrix.hh:984
Dune::DiagonalMatrix::umtv
void umtv(const X &x, Y &y) const
y += A^T x
Definition diagonalmatrix.hh:326
Dune::DiagonalRowVectorConst::const_iterator
ConstIterator const_iterator
typedef for stl compliant access
Definition diagonalmatrix.hh:837
Dune::DiagonalMatrix::infinity_norm_real
double infinity_norm_real() const
simplified infinity norm (uses Manhattan norm for complex values)
Definition diagonalmatrix.hh:444
Dune::DiagonalMatrixWrapper::DiagonalMatrixWrapper
DiagonalMatrixWrapper(const DiagonalMatrixType *mat)
Definition diagonalmatrix.hh:747
Dune::DiagonalMatrix::umv
void umv(const X &x, Y &y) const
y += A x
Definition diagonalmatrix.hh:314
Dune::DiagonalMatrix::Iterator
ContainerWrapperIterator< const WrapperType, reference, reference > Iterator
Iterator class for sequential access.
Definition diagonalmatrix.hh:160
Dune::mutable_reference< DiagonalRowVectorConst< K, n > >::type
DiagonalRowVector< K, n > type
Definition diagonalmatrix.hh:1049
Dune::DiagonalMatrix::mv
void mv(const X &x, Y &y) const
y = A x
Definition diagonalmatrix.hh:295
Dune::DiagonalMatrix::frobenius_norm
double frobenius_norm() const
frobenius norm: sqrt(sum over squared values of entries)
Definition diagonalmatrix.hh:426
Dune::DiagonalMatrix::end
ConstIterator end() const
end iterator
Definition diagonalmatrix.hh:211
Dune::DiagonalMatrix::cols
static constexpr int cols
The number of columns.
Definition diagonalmatrix.hh:87
Dune::DiagonalRowVectorConst::dimension
static constexpr int dimension
Definition diagonalmatrix.hh:785
Dune::DiagonalRowVectorConst::p_
K * p_
Definition diagonalmatrix.hh:915
Dune::DiagonalRowVectorConst::rowIndex
size_type rowIndex() const
index of this row in surrounding matrix
Definition diagonalmatrix.hh:886
Dune::ContainerWrapperIterator::dereference
R dereference() const
Definition diagonalmatrix.hh:1142
Dune::DiagonalRowVector::operator=
DiagonalRowVector & operator=(const K &k)
Assignment operator for scalar.
Definition diagonalmatrix.hh:950
Dune::DiagonalMatrix::operator!=
bool operator!=(const DiagonalMatrix &other) const
incomparison operator
Definition diagonalmatrix.hh:285
Dune::ContainerWrapperIterator::ContainerWrapperIterator
ContainerWrapperIterator()
Definition diagonalmatrix.hh:1090
Dune::DiagonalMatrix::field_type
value_type field_type
Definition diagonalmatrix.hh:65
Dune::ContainerWrapperIterator::advance
void advance(int n)
Definition diagonalmatrix.hh:1164
Dune::DiagonalMatrix::begin
ConstIterator begin() const
begin iterator
Definition diagonalmatrix.hh:205
Dune::DiagonalRowVector::begin
Iterator begin()
begin iterator
Definition diagonalmatrix.hh:971
Dune::DiagonalMatrix::mmv
void mmv(const X &x, Y &y) const
y -= A x
Definition diagonalmatrix.hh:350
Dune::DiagonalMatrix::operator/=
DiagonalMatrix & operator/=(const K &k)
vector space division by scalar
Definition diagonalmatrix.hh:270
Dune::DiagonalMatrix::const_iterator
ConstIterator const_iterator
typedef for stl compliant access
Definition diagonalmatrix.hh:198
Dune::DiagonalMatrix::const_reference
const_row_type const_reference
Definition diagonalmatrix.hh:81
Dune::DiagonalMatrix::identical
bool identical(const DiagonalMatrix< K, n > &other) const
Check if matrix is the same object as the other matrix.
Definition diagonalmatrix.hh:147
Dune::DiagonalMatrixWrapper::realIndex
size_type realIndex(int i) const
Definition diagonalmatrix.hh:751
Dune::DiagonalMatrix::end
Iterator end()
end iterator
Definition diagonalmatrix.hh:175
Dune::DiagonalRowVectorConst::operator[]
const K & operator[](size_type i) const
same for read only access
Definition diagonalmatrix.hh:821
Dune::DiagonalRowVector::DiagonalRowVector
DiagonalRowVector()
Constructor making uninitialized vector.
Definition diagonalmatrix.hh:941
Dune::DiagonalMatrix::reference
row_type reference
Definition diagonalmatrix.hh:78
Dune::DiagonalRowVectorConst::operator&
DiagonalRowVectorConst * operator&()
Definition diagonalmatrix.hh:909
Dune::DiagonalRowVectorConst::operator==
bool operator==(const DiagonalRowVectorConst &y) const
Binary vector comparison.
Definition diagonalmatrix.hh:866
Dune::DiagonalMatrix::frobenius_norm2
double frobenius_norm2() const
square of frobenius norm, need for block recursion
Definition diagonalmatrix.hh:432
Dune::DiagonalMatrix::DiagonalMatrix
constexpr DiagonalMatrix()=default
Default constructor.
Dune::DiagonalMatrix::mtv
void mtv(const X &x, Y &y) const
y = A^T x
Definition diagonalmatrix.hh:307
Dune::DiagonalRowVector< K, DiagonalMatrixType::rows >::ConstIterator
ContainerWrapperIterator< DiagonalRowVectorConst< K, n >, const K, const K & > ConstIterator
Definition diagonalmatrix.hh:997
Dune::DiagonalMatrixWrapper::identical
bool identical(const DiagonalMatrixWrapper &other) const
Definition diagonalmatrix.hh:762
Dune::DiagonalMatrix::usmtv
void usmtv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A^T x
Definition diagonalmatrix.hh:399
Dune::ContainerWrapperIterator::decrement
void decrement()
Definition diagonalmatrix.hh:1153
Dune::ContainerWrapperIterator::index
std::ptrdiff_t index() const
Definition diagonalmatrix.hh:1176
Dune::DiagonalMatrix::diagonal
const FieldVector< K, n > & diagonal() const
Get const reference to diagonal vector.
Definition diagonalmatrix.hh:592
Dune::DiagonalMatrix::invert
void invert()
Compute inverse.
Definition diagonalmatrix.hh:462
Dune::DiagonalRowVector::operator&
DiagonalRowVector * operator&()
Definition diagonalmatrix.hh:1015
Dune::DiagonalMatrix::diagonal
const K & diagonal(size_type i) const
Get const reference to diagonal entry.
Definition diagonalmatrix.hh:580
Dune::DiagonalRowVectorConst::N
size_type N() const
number of blocks in the vector (are of size 1 here)
Definition diagonalmatrix.hh:874
Dune::DiagonalMatrix::DiagonalMatrix
DiagonalMatrix(std::initializer_list< K > const &l)
Construct diagonal matrix from an initializer list.
Definition diagonalmatrix.hh:119
Dune::DiagonalMatrix::ColIterator
row_type::Iterator ColIterator
rename the iterators for easier access
Definition diagonalmatrix.hh:166
Dune::DiagonalRowVector< K, DiagonalMatrixType::rows >::field_type
K field_type
Definition diagonalmatrix.hh:932
Dune::DiagonalMatrix::operator[]
reference operator[](size_type i)
Return reference object as row replacement.
Definition diagonalmatrix.hh:568
Dune::const_reference< DiagonalRowVector< K, n > >::type
DiagonalRowVectorConst< K, n > type
Definition diagonalmatrix.hh:1031
Dune::DiagonalRowVector::end
Iterator end()
end iterator
Definition diagonalmatrix.hh:977
Dune::DiagonalMatrix::DiagonalMatrix
DiagonalMatrix(const FieldVector< K, n > &diag)
Constructor initializing the diagonal with a vector.
Definition diagonalmatrix.hh:107
Dune::DiagonalRowVector< K, DiagonalMatrixType::rows >::size_type
std::size_t size_type
Definition diagonalmatrix.hh:938
Dune::DiagonalRowVectorConst::DiagonalMatrixWrapper
friend class DiagonalMatrixWrapper
Definition diagonalmatrix.hh:780
Dune::DiagonalMatrix::usmv
void usmv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A x
Definition diagonalmatrix.hh:386
Dune::DiagonalMatrix::infinity_norm
double infinity_norm() const
infinity norm (row sum norm, how to generalize for blocks?)
Definition diagonalmatrix.hh:438
Dune::DiagonalMatrix::operator+=
DiagonalMatrix & operator+=(const DiagonalMatrix &y)
vector space addition
Definition diagonalmatrix.hh:235
Dune::DiagonalMatrix::block_type
K block_type
export the type representing the components
Definition diagonalmatrix.hh:68
Dune::DiagonalMatrix::umhv
void umhv(const X &x, Y &y) const
y += A^H x
Definition diagonalmatrix.hh:338
Dune::DiagonalMatrix::beforeBegin
Iterator beforeBegin()
Definition diagonalmatrix.hh:189
Dune::DenseMatrixAssigner< DenseMatrix, DiagonalMatrix< field, N > >::apply
static void apply(DenseMatrix &denseMatrix, DiagonalMatrix< field, N > const &rhs)
Definition diagonalmatrix.hh:1188
Dune::ContainerWrapperIterator::ContainerWrapperIterator
ContainerWrapperIterator(const MyType &other)
Definition diagonalmatrix.hh:1106
Dune::DiagonalRowVectorConst::end
ConstIterator end() const
end ConstIterator
Definition diagonalmatrix.hh:846
Dune::DiagonalRowVectorConst::size_type
std::size_t size_type
The type used for the index access and size operation.
Definition diagonalmatrix.hh:798
Dune::DiagonalMatrix::operator=
DiagonalMatrix & operator=(const K &k)
Assignment from a scalar.
Definition diagonalmatrix.hh:132
Dune::DiagonalRowVectorConst::DiagonalRowVectorConst
DiagonalRowVectorConst()
Constructor making uninitialized vector.
Definition diagonalmatrix.hh:807
Dune::DiagonalMatrix::beforeEnd
Iterator beforeEnd()
Definition diagonalmatrix.hh:182
Dune::DiagonalRowVectorConst::realIndex
size_type realIndex(int i) const
Definition diagonalmatrix.hh:899
Dune::DiagonalMatrix::operator<<
friend std::ostream & operator<<(std::ostream &s, const DiagonalMatrix< K, n > &a)
Sends the matrix to an output stream.
Definition diagonalmatrix.hh:557
Dune::DiagonalMatrix::value_type
K value_type
export the type representing the field
Definition diagonalmatrix.hh:64
Dune::DiagonalRowVectorConst::block_type
K block_type
export the type representing the components
Definition diagonalmatrix.hh:795
Dune::DiagonalMatrix::determinant
K determinant() const
calculates the determinant of this matrix
Definition diagonalmatrix.hh:470
Dune::FieldTraits< DiagonalMatrix< K, n > >::real_type
FieldTraits< K >::real_type real_type
Definition diagonalmatrix.hh:613
Dune::DiagonalRowVectorConst::beforeBegin
ConstIterator beforeBegin() const
Definition diagonalmatrix.hh:860
Dune::DiagonalMatrixWrapper::DiagonalMatrixWrapper
DiagonalMatrixWrapper()
Definition diagonalmatrix.hh:743
Dune::DiagonalRowVectorConst::ConstIterator
ContainerWrapperIterator< DiagonalRowVectorConst< K, n >, const K, const K & > ConstIterator
ConstIterator class for sequential access.
Definition diagonalmatrix.hh:835
Dune::DiagonalMatrix::begin
Iterator begin()
begin iterator
Definition diagonalmatrix.hh:169
Dune::DiagonalMatrix::operator==
bool operator==(const DiagonalMatrix &other) const
comparison operator
Definition diagonalmatrix.hh:279
Dune::DiagonalMatrix::const_row_type
DiagonalRowVectorConst< K, n > const_row_type
Definition diagonalmatrix.hh:80
Dune::DiagonalMatrix::row_type
DiagonalRowVector< K, n > row_type
Each row is implemented by a field vector.
Definition diagonalmatrix.hh:77
Dune::ContainerWrapperIterator::equals
bool equals(const MyType &other) const
Definition diagonalmatrix.hh:1132
Dune::DiagonalMatrix::RowIterator
Iterator RowIterator
rename the iterators for easier access
Definition diagonalmatrix.hh:164
Dune::DiagonalRowVector< K, DiagonalMatrixType::rows >::block_type
K block_type
Definition diagonalmatrix.hh:935
Dune::DiagonalMatrix::beforeEnd
ConstIterator beforeEnd() const
Definition diagonalmatrix.hh:218
Dune::DiagonalMatrix::DiagonalMatrix
DiagonalMatrix(const DiagonalMatrix< OtherK, n > &other)
Converting constructor.
Definition diagonalmatrix.hh:127
Dune::DiagonalRowVectorConst::diagonal
const K & diagonal() const
the diagonal value
Definition diagonalmatrix.hh:892
DUNE_THROW
#define DUNE_THROW(E,...)
Definition exceptions.hh:314
Dune::operator*
constexpr decltype(auto) operator*() const
Dereferencing operator.
Definition iteratorfacades.hh:1119
Dune
Dune namespace
Definition alignedallocator.hh:13
Dune::conjugateComplex
constexpr K conjugateComplex(const K &x)
compute conjugate complex of x
Definition math.hh:146
Dune::DenseMatrix
A dense n x m matrix.
Definition densematrix.hh:145
Dune::DenseMatrix::M
constexpr size_type M() const
number of columns
Definition densematrix.hh:708
Dune::DenseMatrix::N
constexpr size_type N() const
number of rows
Definition densematrix.hh:702
Dune::FieldMatrix
A dense n x m matrix.
Definition fmatrix.hh:117
Dune::FieldVector
vector space out of a tensor product of fields.
Definition fvector.hh:97
Dune::DenseMatrixAssigner
you have to specialize this structure for any type that should be assignable to a DenseMatrix
Definition densematrix.hh:61
Dune::FMatrixError
Error thrown if operations of a FieldMatrix fail.
Definition densematrix.hh:131
Dune::DiagonalRowVectorConst
Definition diagonalmatrix.hh:778
Dune::DiagonalRowVector
Definition diagonalmatrix.hh:921
Dune::DiagonalMatrixWrapper
Definition diagonalmatrix.hh:730
Dune::ContainerWrapperIterator
Iterator class for sparse vector-like containers.
Definition diagonalmatrix.hh:1078
Dune::ContainerWrapperIterator::ContainerWrapperIterator
ContainerWrapperIterator(const MyConstType &other)
Definition diagonalmatrix.hh:1111
Dune::ContainerWrapperIterator::equals
bool equals(const MyConstType &other) const
Definition diagonalmatrix.hh:1137
Dune::DiagonalMatrix
A diagonal matrix of static size.
Definition diagonalmatrix.hh:56
Dune::DynamicMatrix
Construct a matrix with a dynamic size.
Definition dynmatrix.hh:61
Dune::RangeError
Default exception class for range errors.
Definition exceptions.hh:348
Dune::real_type
Dune::FieldTraits::field_type
T field_type
export the type representing the field
Definition ftraits.hh:28
Dune::FieldTraits::real_type
T real_type
export the type representing the real type of the field
Definition ftraits.hh:30
Dune::const_reference
Get the 'const' version of a reference to a mutable object.
Definition genericiterator.hh:87
Dune::mutable_reference
get the 'mutable' version of a reference to a const object
Definition genericiterator.hh:116
Dune::BidirectionalIteratorFacade
Facade class for stl conformant bidirectional iterators.
Definition iteratorfacades.hh:275
Dune::PromotionTraits::PromotedType
decltype(std::declval< T1 >()+std::declval< T2 >()) PromotedType
Definition promotiontraits.hh:28
Dune::type