1 #ifndef DUNE_COMMON_IDENTITYMATRIX_HH 2 #define DUNE_COMMON_IDENTITYMATRIX_HH 4 #warning Deprecated since dune-common 2.5: If you really do need an identity matrix, use DiagonalMatrix or ScalarIdentityMatrix (from dune-istl) instead! 36 template<
class K,
int N >
50 template<
class X,
class Y >
51 void mv (
const X &x, Y &y )
const 57 template<
class X,
class Y >
58 void mtv (
const X &x, Y &y )
const 64 template<
class X,
class Y >
65 void umv (
const X &x, Y &y )
const 71 template<
class X,
class Y >
72 void umtv (
const X &x, Y &y )
const 78 template<
class X,
class Y >
79 void umhv (
const X &x, Y &y )
const 85 template<
class X,
class Y >
86 void mmv (
const X &x, Y &y )
const 92 template<
class X,
class Y >
93 void mmtv (
const X &x, Y &y )
const 99 template<
class X,
class Y >
100 void mmhv (
const X &x, Y &y )
const 106 template<
class X,
class Y >
108 const X& x, Y& y)
const 114 template<
class X,
class Y >
116 const X& x, Y& y)
const 122 template<
class X,
class Y >
124 const X& x, Y& y)
const 154 template <
class DenseMatrix,
class field,
int N>
159 denseMatrix = field(0);
160 for (
int i = 0; i < N; ++i)
161 denseMatrix[i][i] = field(1);
166 #endif // #ifndef DUNE_COMMON_IDENTITYMATRIX_HH std::size_t size_type
size type
Definition: identitymatrix.hh:42
constexpr size_type cols() const
return number of columns
Definition: identitymatrix.hh:47
void usmv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A x
Definition: identitymatrix.hh:107
FieldTraits< field_type >::real_type frobenius_norm() const
frobenius norm: sqrt(sum over squared values of entries)
Definition: identitymatrix.hh:130
FieldTraits< field_type >::real_type infinity_norm_real() const
simplified infinity norm (uses Manhattan norm for complex values)
Definition: identitymatrix.hh:148
static void apply(DenseMatrix &denseMatrix, IdentityMatrix< field, N > const &rhs)
Definition: identitymatrix.hh:156
void usmhv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A^H x
Definition: identitymatrix.hh:123
void usmtv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A^T x
Definition: identitymatrix.hh:115
void mmhv(const X &x, Y &y) const
y -= A^H x
Definition: identitymatrix.hh:100
void umv(const X &x, Y &y) const
y += A x
Definition: identitymatrix.hh:65
void umhv(const X &x, Y &y) const
y += A^H x
Definition: identitymatrix.hh:79
FieldTraits< field_type >::real_type frobenius_norm2() const
square of frobenius norm, need for block recursion
Definition: identitymatrix.hh:136
Dune namespace.
Definition: alignment.hh:10
Some useful basic math stuff.
K field_type
field type
Definition: identitymatrix.hh:40
Macro for wrapping boundary checks.
FieldTraits< field_type >::real_type infinity_norm() const
infinity norm (row sum norm, how to generalize for blocks?)
Definition: identitymatrix.hh:142
void mmv(const X &x, Y &y) const
y -= A x
Definition: identitymatrix.hh:86
void mtv(const X &x, Y &y) const
y = A^T x
Definition: identitymatrix.hh:58
T real_type
export the type representing the real type of the field
Definition: ftraits.hh:28
constexpr size_type rows() const
return number of rows
Definition: identitymatrix.hh:45
size_type M() const
number of columns
Definition: densematrix.hh:677
you have to specialize this structure for any type that should be assignable to a DenseMatrix ...
Definition: densematrix.hh:74
A dense n x m matrix.
Definition: densematrix.hh:25
void umtv(const X &x, Y &y) const
y += A^T x
Definition: identitymatrix.hh:72
void mv(const X &x, Y &y) const
y = A x
Definition: identitymatrix.hh:51
Read-only identity matrix.
Definition: identitymatrix.hh:37
Implements a matrix constructed from a given type representing a field and compile-time given number ...
size_type N() const
number of rows
Definition: densematrix.hh:671
Type traits to determine the type of reals (when working with complex numbers)
T field_type
export the type representing the field
Definition: ftraits.hh:26
void mmtv(const X &x, Y &y) const
y -= A^T x
Definition: identitymatrix.hh:93
#define DUNE_ASSERT_BOUNDS(cond)
If DUNE_CHECK_BOUNDS is defined: check if condition cond holds; otherwise, do nothing.
Definition: boundschecking.hh:28