Loading...
Searching...
No Matches
multitypeblockmatrix.hh
Go to the documentation of this file.
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_ISTL_MULTITYPEBLOCKMATRIX_HH
#define DUNE_ISTL_MULTITYPEBLOCKMATRIX_HH
#include <cmath>
#include <iostream>
#include <tuple>
#include <dune/common/hybridutilities.hh>
#include "istlexception.hh"
// forward declaration
namespace Dune
{
template<typename FirstRow, typename... Args>
class MultiTypeBlockMatrix;
template<int I, int crow, int remain_row>
class MultiTypeBlockMatrix_Solver;
}
#include "gsetc.hh"
namespace Dune {
template<typename FirstRow, typename... Args>
class MultiTypeBlockMatrix
: public std::tuple<FirstRow, Args...>
{
using ParentType = std::tuple<FirstRow, Args...>;
public:
using ParentType::ParentType;
typedef MultiTypeBlockMatrix<FirstRow, Args...> type;
using size_type = std::size_t;
using field_type = Std::detected_t<std::common_type_t,
typename FieldTraits<FirstRow>::field_type, typename FieldTraits<Args>::field_type...>;
using real_type = Std::detected_t<std::common_type_t,
typename FieldTraits<FirstRow>::real_type, typename FieldTraits<Args>::real_type...>;
// make sure that we have an std::common_type: using an assertion produces a more readable error message
// than a compiler template instantiation error
static_assert ( sizeof...(Args) == 0 or
not (std::is_same_v<field_type, Std::nonesuch> or std::is_same_v<real_type, Std::nonesuch>),
"No std::common_type implemented for the given field_type/real_type of the Args. Please provide an implementation and check that a FieldTraits class is present for your type.");
static constexpr size_type N()
{
return 1+sizeof...(Args);
}
static constexpr size_type M()
{
return FirstRow::size();
}
template< size_type index >
auto
operator[] ([[maybe_unused]] const std::integral_constant< size_type, index > indexVariable)
-> decltype(std::get<index>(*this))
{
return std::get<index>(*this);
}
template< size_type index >
auto
operator[] ([[maybe_unused]] const std::integral_constant< size_type, index > indexVariable) const
-> decltype(std::get<index>(*this))
{
return std::get<index>(*this);
}
template<typename T>
void operator= (const T& newval) {
using namespace Dune::Hybrid;
auto size = index_constant<1+sizeof...(Args)>();
// Since Dune::Hybrid::size(MultiTypeBlockMatrix) is not implemented,
// we cannot use a plain forEach(*this, ...). This could be achieved,
// e.g., by implementing a static size() method.
forEach(integralRange(size), [&](auto&& i) {
(*this)[i] = newval;
});
}
//===== vector space arithmetic
MultiTypeBlockMatrix& operator*= (const field_type& k)
{
auto size = index_constant<N()>();
Hybrid::forEach(Hybrid::integralRange(size), [&](auto&& i) {
(*this)[i] *= k;
});
return *this;
}
MultiTypeBlockMatrix& operator/= (const field_type& k)
{
auto size = index_constant<N()>();
Hybrid::forEach(Hybrid::integralRange(size), [&](auto&& i) {
(*this)[i] /= k;
});
return *this;
}
MultiTypeBlockMatrix& operator+= (const MultiTypeBlockMatrix& b)
{
auto size = index_constant<N()>();
Hybrid::forEach(Hybrid::integralRange(size), [&](auto&& i) {
(*this)[i] += b[i];
});
return *this;
}
MultiTypeBlockMatrix& operator-= (const MultiTypeBlockMatrix& b)
{
auto size = index_constant<N()>();
Hybrid::forEach(Hybrid::integralRange(size), [&](auto&& i) {
(*this)[i] -= b[i];
});
return *this;
}
template<typename X, typename Y>
void mv (const X& x, Y& y) const {
static_assert(X::size() == M(), "length of x does not match row length");
static_assert(Y::size() == N(), "length of y does not match row count");
y = 0; //reset y (for mv uses umv)
umv(x,y);
}
template<typename X, typename Y>
void umv (const X& x, Y& y) const {
static_assert(X::size() == M(), "length of x does not match row length");
static_assert(Y::size() == N(), "length of y does not match row count");
using namespace Dune::Hybrid;
forEach(integralRange(Hybrid::size(y)), [&](auto&& i) {
using namespace Dune::Hybrid; // needed for icc, see issue #31
forEach(integralRange(Hybrid::size(x)), [&](auto&& j) {
(*this)[i][j].umv(x[j], y[i]);
});
});
}
template<typename X, typename Y>
void mmv (const X& x, Y& y) const {
static_assert(X::size() == M(), "length of x does not match row length");
static_assert(Y::size() == N(), "length of y does not match row count");
using namespace Dune::Hybrid;
forEach(integralRange(Hybrid::size(y)), [&](auto&& i) {
using namespace Dune::Hybrid; // needed for icc, see issue #31
forEach(integralRange(Hybrid::size(x)), [&](auto&& j) {
(*this)[i][j].mmv(x[j], y[i]);
});
});
}
template<typename AlphaType, typename X, typename Y>
void usmv (const AlphaType& alpha, const X& x, Y& y) const {
static_assert(X::size() == M(), "length of x does not match row length");
static_assert(Y::size() == N(), "length of y does not match row count");
using namespace Dune::Hybrid;
forEach(integralRange(Hybrid::size(y)), [&](auto&& i) {
using namespace Dune::Hybrid; // needed for icc, see issue #31
forEach(integralRange(Hybrid::size(x)), [&](auto&& j) {
(*this)[i][j].usmv(alpha, x[j], y[i]);
});
});
}
template<typename X, typename Y>
void mtv (const X& x, Y& y) const {
static_assert(X::size() == N(), "length of x does not match number of rows");
static_assert(Y::size() == M(), "length of y does not match number of columns");
y = 0;
umtv(x,y);
}
template<typename X, typename Y>
void umtv (const X& x, Y& y) const {
static_assert(X::size() == N(), "length of x does not match number of rows");
static_assert(Y::size() == M(), "length of y does not match number of columns");
using namespace Dune::Hybrid;
forEach(integralRange(Hybrid::size(y)), [&](auto&& i) {
using namespace Dune::Hybrid; // needed for icc, see issue #31
forEach(integralRange(Hybrid::size(x)), [&](auto&& j) {
(*this)[j][i].umtv(x[j], y[i]);
});
});
}
template<typename X, typename Y>
void mmtv (const X& x, Y& y) const {
static_assert(X::size() == N(), "length of x does not match number of rows");
static_assert(Y::size() == M(), "length of y does not match number of columns");
using namespace Dune::Hybrid;
forEach(integralRange(Hybrid::size(y)), [&](auto&& i) {
using namespace Dune::Hybrid; // needed for icc, see issue #31
forEach(integralRange(Hybrid::size(x)), [&](auto&& j) {
(*this)[j][i].mmtv(x[j], y[i]);
});
});
}
template<typename X, typename Y>
void usmtv (const field_type& alpha, const X& x, Y& y) const {
static_assert(X::size() == N(), "length of x does not match number of rows");
static_assert(Y::size() == M(), "length of y does not match number of columns");
using namespace Dune::Hybrid;
forEach(integralRange(Hybrid::size(y)), [&](auto&& i) {
using namespace Dune::Hybrid; // needed for icc, see issue #31
forEach(integralRange(Hybrid::size(x)), [&](auto&& j) {
(*this)[j][i].usmtv(alpha, x[j], y[i]);
});
});
}
template<typename X, typename Y>
void umhv (const X& x, Y& y) const {
static_assert(X::size() == N(), "length of x does not match number of rows");
static_assert(Y::size() == M(), "length of y does not match number of columns");
using namespace Dune::Hybrid;
forEach(integralRange(Hybrid::size(y)), [&](auto&& i) {
using namespace Dune::Hybrid; // needed for icc, see issue #31
forEach(integralRange(Hybrid::size(x)), [&](auto&& j) {
(*this)[j][i].umhv(x[j], y[i]);
});
});
}
template<typename X, typename Y>
void mmhv (const X& x, Y& y) const {
static_assert(X::size() == N(), "length of x does not match number of rows");
static_assert(Y::size() == M(), "length of y does not match number of columns");
using namespace Dune::Hybrid;
forEach(integralRange(Hybrid::size(y)), [&](auto&& i) {
using namespace Dune::Hybrid; // needed for icc, see issue #31
forEach(integralRange(Hybrid::size(x)), [&](auto&& j) {
(*this)[j][i].mmhv(x[j], y[i]);
});
});
}
template<typename X, typename Y>
void usmhv (const field_type& alpha, const X& x, Y& y) const {
static_assert(X::size() == N(), "length of x does not match number of rows");
static_assert(Y::size() == M(), "length of y does not match number of columns");
using namespace Dune::Hybrid;
forEach(integralRange(Hybrid::size(y)), [&](auto&& i) {
using namespace Dune::Hybrid; // needed for icc, see issue #31
forEach(integralRange(Hybrid::size(x)), [&](auto&& j) {
(*this)[j][i].usmhv(alpha, x[j], y[i]);
});
});
}
//===== norms
real_type frobenius_norm2 () const
{
real_type sum=0;
auto rows = index_constant<N()>();
Hybrid::forEach(Hybrid::integralRange(rows), [&](auto&& i) {
auto cols = index_constant<MultiTypeBlockMatrix<FirstRow, Args...>::M()>();
Hybrid::forEach(Hybrid::integralRange(cols), [&](auto&& j) {
sum += (*this)[i][j].frobenius_norm2();
});
});
return sum;
}
real_type frobenius_norm () const
{
return sqrt(frobenius_norm2());
}
real_type infinity_norm () const
{
using std::max;
real_type norm=0;
auto rows = index_constant<N()>();
Hybrid::forEach(Hybrid::integralRange(rows), [&](auto&& i) {
real_type sum=0;
auto cols = index_constant<MultiTypeBlockMatrix<FirstRow, Args...>::M()>();
Hybrid::forEach(Hybrid::integralRange(cols), [&](auto&& j) {
sum += (*this)[i][j].infinity_norm();
});
norm = max(sum, norm);
});
return norm;
}
real_type infinity_norm_real () const
{
using std::max;
real_type norm=0;
auto rows = index_constant<N()>();
Hybrid::forEach(Hybrid::integralRange(rows), [&](auto&& i) {
real_type sum=0;
auto cols = index_constant<MultiTypeBlockMatrix<FirstRow, Args...>::M()>();
Hybrid::forEach(Hybrid::integralRange(cols), [&](auto&& j) {
sum += (*this)[i][j].infinity_norm_real();
});
norm = max(sum, norm);
});
return norm;
}
};
template <typename... Rows>
struct FieldTraits< MultiTypeBlockMatrix<Rows...> >
{
using field_type = typename MultiTypeBlockMatrix<Rows...>::field_type;
using real_type = typename MultiTypeBlockMatrix<Rows...>::real_type;
};
template<typename T1, typename... Args>
std::ostream& operator<< (std::ostream& s, const MultiTypeBlockMatrix<T1,Args...>& m) {
auto N = index_constant<MultiTypeBlockMatrix<T1,Args...>::N()>();
auto M = index_constant<MultiTypeBlockMatrix<T1,Args...>::M()>();
using namespace Dune::Hybrid;
forEach(integralRange(N), [&](auto&& i) {
using namespace Dune::Hybrid; // needed for icc, see issue #31
forEach(integralRange(M), [&](auto&& j) {
s << "\t(" << i << ", " << j << "): \n" << m[i][j];
});
});
s << std::endl;
return s;
}
//make algmeta_itsteps known
template<int I, typename M>
struct algmeta_itsteps;
template<int I, int crow, int ccol, int remain_col> //MultiTypeBlockMatrix_Solver_Col: iterating over one row
class MultiTypeBlockMatrix_Solver_Col { //calculating b- A[i][j]*x[j]
public:
template <typename Trhs, typename TVector, typename TMatrix, typename K>
static void calc_rhs(const TMatrix& A, TVector& x, TVector& v, Trhs& b, const K& w) {
std::get<ccol>( std::get<crow>(A) ).mmv( std::get<ccol>(x), b );
MultiTypeBlockMatrix_Solver_Col<I, crow, ccol+1, remain_col-1>::calc_rhs(A,x,v,b,w); //next column element
}
};
template<int I, int crow, int ccol> //MultiTypeBlockMatrix_Solver_Col recursion end
class MultiTypeBlockMatrix_Solver_Col<I,crow,ccol,0> {
public:
template <typename Trhs, typename TVector, typename TMatrix, typename K>
static void calc_rhs(const TMatrix&, TVector&, TVector&, Trhs&, const K&) {}
};
template<int I, int crow, int remain_row>
class MultiTypeBlockMatrix_Solver {
public:
template <typename TVector, typename TMatrix, typename K>
static void dbgs(const TMatrix& A, TVector& x, const TVector& b, const K& w) {
TVector xold(x);
xold=x; //store old x values
MultiTypeBlockMatrix_Solver<I,crow,remain_row>::dbgs(A,x,x,b,w);
x *= w;
x.axpy(1-w,xold); //improve x
}
template <typename TVector, typename TMatrix, typename K>
static void dbgs(const TMatrix& A, TVector& x, TVector& v, const TVector& b, const K& w) {
auto rhs = std::get<crow> (b);
MultiTypeBlockMatrix_Solver_Col<I,crow,0, TMatrix::M()>::calc_rhs(A,x,v,rhs,w); // calculate right side of equation
//solve on blocklevel I-1
using M =
typename std::remove_cv<
typename std::remove_reference<
decltype(std::get<crow>( std::get<crow>(A)))
>::type
>::type;
algmeta_itsteps<I-1,M>::dbgs(std::get<crow>( std::get<crow>(A)), std::get<crow>(x),rhs,w);
MultiTypeBlockMatrix_Solver<I,crow+1,remain_row-1>::dbgs(A,x,v,b,w); //next row
}
template <typename TVector, typename TMatrix, typename K>
static void bsorf(const TMatrix& A, TVector& x, const TVector& b, const K& w) {
TVector v;
v=x; //use latest x values in right side calculation
MultiTypeBlockMatrix_Solver<I,crow,remain_row>::bsorf(A,x,v,b,w);
}
template <typename TVector, typename TMatrix, typename K> //recursion over all matrix rows (A)
static void bsorf(const TMatrix& A, TVector& x, TVector& v, const TVector& b, const K& w) {
auto rhs = std::get<crow> (b);
MultiTypeBlockMatrix_Solver_Col<I,crow,0,TMatrix::M()>::calc_rhs(A,x,v,rhs,w); // calculate right side of equation
//solve on blocklevel I-1
using M =
typename std::remove_cv<
typename std::remove_reference<
decltype(std::get<crow>( std::get<crow>(A)))
>::type
>::type;
algmeta_itsteps<I-1,M>::bsorf(std::get<crow>( std::get<crow>(A)), std::get<crow>(v),rhs,w);
std::get<crow>(x).axpy(w,std::get<crow>(v));
MultiTypeBlockMatrix_Solver<I,crow+1,remain_row-1>::bsorf(A,x,v,b,w); //next row
}
template <typename TVector, typename TMatrix, typename K>
static void bsorb(const TMatrix& A, TVector& x, const TVector& b, const K& w) {
TVector v;
v=x; //use latest x values in right side calculation
MultiTypeBlockMatrix_Solver<I,crow,remain_row>::bsorb(A,x,v,b,w);
}
template <typename TVector, typename TMatrix, typename K> //recursion over all matrix rows (A)
static void bsorb(const TMatrix& A, TVector& x, TVector& v, const TVector& b, const K& w) {
auto rhs = std::get<crow> (b);
MultiTypeBlockMatrix_Solver_Col<I,crow,0, TMatrix::M()>::calc_rhs(A,x,v,rhs,w); // calculate right side of equation
//solve on blocklevel I-1
using M =
typename std::remove_cv<
typename std::remove_reference<
decltype(std::get<crow>( std::get<crow>(A)))
>::type
>::type;
algmeta_itsteps<I-1,M>::bsorb(std::get<crow>( std::get<crow>(A)), std::get<crow>(v),rhs,w);
std::get<crow>(x).axpy(w,std::get<crow>(v));
MultiTypeBlockMatrix_Solver<I,crow-1,remain_row-1>::bsorb(A,x,v,b,w); //next row
}
template <typename TVector, typename TMatrix, typename K>
static void dbjac(const TMatrix& A, TVector& x, const TVector& b, const K& w) {
TVector v(x);
v=0; //calc new x in v
MultiTypeBlockMatrix_Solver<I,crow,remain_row>::dbjac(A,x,v,b,w);
x.axpy(w,v); //improve x
}
template <typename TVector, typename TMatrix, typename K>
static void dbjac(const TMatrix& A, TVector& x, TVector& v, const TVector& b, const K& w) {
auto rhs = std::get<crow> (b);
MultiTypeBlockMatrix_Solver_Col<I,crow,0, TMatrix::M()>::calc_rhs(A,x,v,rhs,w); // calculate right side of equation
//solve on blocklevel I-1
using M =
typename std::remove_cv<
typename std::remove_reference<
decltype(std::get<crow>( std::get<crow>(A)))
>::type
>::type;
algmeta_itsteps<I-1,M>::dbjac(std::get<crow>( std::get<crow>(A)), std::get<crow>(v),rhs,w);
MultiTypeBlockMatrix_Solver<I,crow+1,remain_row-1>::dbjac(A,x,v,b,w); //next row
}
};
template<int I, int crow> //recursion end for remain_row = 0
class MultiTypeBlockMatrix_Solver<I,crow,0> {
public:
template <typename TVector, typename TMatrix, typename K>
static void dbgs(const TMatrix&, TVector&, TVector&,
const TVector&, const K&) {}
template <typename TVector, typename TMatrix, typename K>
static void bsorf(const TMatrix&, TVector&, TVector&,
const TVector&, const K&) {}
template <typename TVector, typename TMatrix, typename K>
static void bsorb(const TMatrix&, TVector&, TVector&,
const TVector&, const K&) {}
template <typename TVector, typename TMatrix, typename K>
static void dbjac(const TMatrix&, TVector&, TVector&,
const TVector&, const K&) {}
};
} // end namespace Dune
namespace std
{
template <size_t i, typename... Args>
struct tuple_element<i,Dune::MultiTypeBlockMatrix<Args...> >
{
using type = typename std::tuple_element<i, std::tuple<Args...> >::type;
};
template <typename... Args>
struct tuple_size<Dune::MultiTypeBlockMatrix<Args...> >
: std::integral_constant<std::size_t, sizeof...(Args)>
{};
}
#endif
gsetc.hh
Simple iterative methods like Jacobi, Gauss-Seidel, SOR, SSOR, etc. in a generic way.
istlexception.hh
Dune::FieldTraits< MultiTypeBlockMatrix< Rows... > >::field_type
typename MultiTypeBlockMatrix< Rows... >::field_type field_type
Definition multitypeblockmatrix.hh:429
Dune::MultiTypeBlockMatrix< T1, Args... >::type
MultiTypeBlockMatrix< T1, Args... > type
Definition multitypeblockmatrix.hh:56
Dune::MultiTypeBlockMatrix_Solver::dbjac
static void dbjac(const TMatrix &A, TVector &x, const TVector &b, const K &w)
Definition multitypeblockmatrix.hh:584
Dune::MultiTypeBlockMatrix::infinity_norm_real
real_type infinity_norm_real() const
Bastardized version of the infinity-norm / row-sum norm.
Definition multitypeblockmatrix.hh:402
Dune::MultiTypeBlockMatrix::operator+=
MultiTypeBlockMatrix & operator+=(const MultiTypeBlockMatrix &b)
Add the entries of another matrix to this one.
Definition multitypeblockmatrix.hh:177
Dune::MultiTypeBlockMatrix::mv
void mv(const X &x, Y &y) const
y = A x
Definition multitypeblockmatrix.hh:205
Dune::MultiTypeBlockMatrix::mmtv
void mmtv(const X &x, Y &y) const
y -= A^T x
Definition multitypeblockmatrix.hh:285
Dune::MultiTypeBlockMatrix::mmhv
void mmhv(const X &x, Y &y) const
y -= A^H x
Definition multitypeblockmatrix.hh:330
Dune::MultiTypeBlockMatrix_Solver< I, crow, 0 >::dbgs
static void dbgs(const TMatrix &, TVector &, TVector &, const TVector &, const K &)
Definition multitypeblockmatrix.hh:614
Dune::MultiTypeBlockMatrix_Solver::dbgs
static void dbgs(const TMatrix &A, TVector &x, const TVector &b, const K &w)
Definition multitypeblockmatrix.hh:500
Dune::MultiTypeBlockMatrix_Solver::bsorb
static void bsorb(const TMatrix &A, TVector &x, const TVector &b, const K &w)
Definition multitypeblockmatrix.hh:556
Dune::MultiTypeBlockMatrix::usmhv
void usmhv(const field_type &alpha, const X &x, Y &y) const
y += alpha A^H x
Definition multitypeblockmatrix.hh:345
Dune::MultiTypeBlockMatrix::usmv
void usmv(const AlphaType &alpha, const X &x, Y &y) const
y += alpha A x
Definition multitypeblockmatrix.hh:245
Dune::MultiTypeBlockMatrix::operator/=
MultiTypeBlockMatrix & operator/=(const field_type &k)
vector space division by scalar
Definition multitypeblockmatrix.hh:161
Dune::MultiTypeBlockMatrix::infinity_norm
real_type infinity_norm() const
Bastardized version of the infinity-norm / row-sum norm.
Definition multitypeblockmatrix.hh:383
std::tuple_element< i, Dune::MultiTypeBlockMatrix< Args... > >::type
typename std::tuple_element< i, std::tuple< Args... > >::type type
Definition multitypeblockmatrix.hh:641
Dune::MultiTypeBlockMatrix_Solver::dbgs
static void dbgs(const TMatrix &A, TVector &x, TVector &v, const TVector &b, const K &w)
Definition multitypeblockmatrix.hh:508
Dune::MultiTypeBlockMatrix_Solver::bsorf
static void bsorf(const TMatrix &A, TVector &x, TVector &v, const TVector &b, const K &w)
Definition multitypeblockmatrix.hh:536
Dune::MultiTypeBlockMatrix::umhv
void umhv(const X &x, Y &y) const
y += A^H x
Definition multitypeblockmatrix.hh:315
Dune::MultiTypeBlockMatrix::N
static constexpr size_type N()
Return the number of matrix rows.
Definition multitypeblockmatrix.hh:84
Dune::MultiTypeBlockMatrix::usmtv
void usmtv(const field_type &alpha, const X &x, Y &y) const
y += alpha A^T x
Definition multitypeblockmatrix.hh:300
Dune::MultiTypeBlockMatrix::operator=
void operator=(const T &newval)
Definition multitypeblockmatrix.hh:136
Dune::MultiTypeBlockMatrix_Solver_Col< I, crow, ccol, 0 >::calc_rhs
static void calc_rhs(const TMatrix &, TVector &, TVector &, Trhs &, const K &)
Definition multitypeblockmatrix.hh:481
Dune::MultiTypeBlockMatrix::umv
void umv(const X &x, Y &y) const
y += A x
Definition multitypeblockmatrix.hh:215
Dune::MultiTypeBlockMatrix_Solver_Col::calc_rhs
static void calc_rhs(const TMatrix &A, TVector &x, TVector &v, Trhs &b, const K &w)
Definition multitypeblockmatrix.hh:471
Dune::MultiTypeBlockMatrix_Solver::bsorf
static void bsorf(const TMatrix &A, TVector &x, const TVector &b, const K &w)
Definition multitypeblockmatrix.hh:529
Dune::MultiTypeBlockMatrix_Solver< I, crow, 0 >::dbjac
static void dbjac(const TMatrix &, TVector &, TVector &, const TVector &, const K &)
Definition multitypeblockmatrix.hh:626
Dune::MultiTypeBlockMatrix< T1, Args... >::size_type
std::size_t size_type
Definition multitypeblockmatrix.hh:59
Dune::MultiTypeBlockMatrix< T1, Args... >::real_type
Std::detected_t< std::common_type_t, typename FieldTraits< T1 >::real_type, typename FieldTraits< Args >::real_type... > real_type
Definition multitypeblockmatrix.hh:74
Dune::MultiTypeBlockMatrix::frobenius_norm2
real_type frobenius_norm2() const
square of frobenius norm, need for block recursion
Definition multitypeblockmatrix.hh:361
Dune::MultiTypeBlockMatrix::frobenius_norm
real_type frobenius_norm() const
frobenius norm: sqrt(sum over squared values of entries)
Definition multitypeblockmatrix.hh:377
Dune::MultiTypeBlockMatrix_Solver< I, crow, 0 >::bsorb
static void bsorb(const TMatrix &, TVector &, TVector &, const TVector &, const K &)
Definition multitypeblockmatrix.hh:622
Dune::MultiTypeBlockMatrix::operator-=
MultiTypeBlockMatrix & operator-=(const MultiTypeBlockMatrix &b)
Subtract the entries of another matrix from this one.
Definition multitypeblockmatrix.hh:192
Dune::FieldTraits< MultiTypeBlockMatrix< Rows... > >::real_type
typename MultiTypeBlockMatrix< Rows... >::real_type real_type
Definition multitypeblockmatrix.hh:430
Dune::MultiTypeBlockMatrix< T1, Args... >::field_type
Std::detected_t< std::common_type_t, typename FieldTraits< T1 >::field_type, typename FieldTraits< Args >::field_type... > field_type
Definition multitypeblockmatrix.hh:66
Dune::MultiTypeBlockMatrix::operator[]
auto operator[](const std::integral_constant< size_type, index > indexVariable) -> decltype(std::get< index >(*this))
Random-access operator.
Definition multitypeblockmatrix.hh:113
Dune::MultiTypeBlockMatrix_Solver::dbjac
static void dbjac(const TMatrix &A, TVector &x, TVector &v, const TVector &b, const K &w)
Definition multitypeblockmatrix.hh:591
Dune::MultiTypeBlockMatrix_Solver< I, crow, 0 >::bsorf
static void bsorf(const TMatrix &, TVector &, TVector &, const TVector &, const K &)
Definition multitypeblockmatrix.hh:618
Dune::MultiTypeBlockMatrix::mtv
void mtv(const X &x, Y &y) const
y = A^T x
Definition multitypeblockmatrix.hh:260
Dune::MultiTypeBlockMatrix::M
static constexpr size_type M()
Return the number of matrix columns.
Definition multitypeblockmatrix.hh:90
Dune::MultiTypeBlockMatrix::mmv
void mmv(const X &x, Y &y) const
y -= A x
Definition multitypeblockmatrix.hh:230
Dune::MultiTypeBlockMatrix::umtv
void umtv(const X &x, Y &y) const
y += A^T x
Definition multitypeblockmatrix.hh:270
Dune::MultiTypeBlockMatrix_Solver::bsorb
static void bsorb(const TMatrix &A, TVector &x, TVector &v, const TVector &b, const K &w)
Definition multitypeblockmatrix.hh:563
Dune::MultiTypeBlockMatrix::operator*=
MultiTypeBlockMatrix & operator*=(const field_type &k)
vector space multiplication with scalar
Definition multitypeblockmatrix.hh:150
std
STL namespace.
Dune
Definition allocator.hh:11
Dune::type
const Dtype_t BaseGetSuperLUType< T >::type
Definition supermatrix.hh:135
Dune::operator<<
std::ostream & operator<<(std::ostream &s, const BlockVector< K, A > &v)
Send BlockVector to an output stream.
Definition bvector.hh:583
Dune::MultiTypeBlockMatrix
A Matrix class to support different block types.
Definition multitypeblockmatrix.hh:46
Dune::algmeta_itsteps::bsorb
static void bsorb(const M &A, X &x, const Y &b, const K &w)
Definition gsetc.hh:461
Dune::algmeta_itsteps::bsorf
static void bsorf(const M &A, X &x, const Y &b, const K &w)
Definition gsetc.hh:418
Dune::algmeta_itsteps::dbjac
static void dbjac(const M &A, X &x, const Y &b, const K &w)
Definition gsetc.hh:504
Dune::algmeta_itsteps::dbgs
static void dbgs(const M &A, X &x, const Y &b, const K &w)
Definition gsetc.hh:378
Dune::MultiTypeBlockMatrix_Solver
solver for MultiTypeBlockVector & MultiTypeBlockMatrix types
Definition multitypeblockmatrix.hh:493
Dune::MultiTypeBlockMatrix_Solver_Col
part of solvers for MultiTypeBlockVector & MultiTypeBlockMatrix types
Definition multitypeblockmatrix.hh:465