DUNE-FEM (unstable)
•All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
diagonalmatrix.hh
Go to the documentation of this file.
3// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
181 typedef ContainerWrapperIterator<const WrapperType, const_reference, const_reference> ConstIterator;
675 return DiagonalMatrix<typename PromotionTraits<K,OtherScalar>::PromotedType, 1>{matrixA.diagonal(0)*matrixB.diagonal(0)};
1056 class ContainerWrapperIterator : public BidirectionalIteratorFacade<ContainerWrapperIterator<CW,T,R>,T, R, int>
1060 friend class ContainerWrapperIterator<CW, typename mutable_reference<T>::type, typename mutable_reference<R>::type>;
1061 friend class ContainerWrapperIterator<CW, typename const_reference<T>::type, typename const_reference<R>::type>;
1063 typedef ContainerWrapperIterator<CW, typename mutable_reference<T>::type, typename mutable_reference<R>::type> MyType;
1064 typedef ContainerWrapperIterator<CW, typename const_reference<T>::type, typename const_reference<R>::type> MyConstType;
Macro for wrapping boundary checks.
Facade class for stl conformant bidirectional iterators.
Definition: iteratorfacades.hh:275
Iterator class for sparse vector-like containers.
Definition: diagonalmatrix.hh:1057
constexpr FieldTraits< value_type >::real_type two_norm() const
two norm sqrt(sum over squared values of entries)
Definition: densevector.hh:642
constexpr FieldTraits< value_type >::real_type two_norm2() const
square of two norm (sum over squared values of entries), need for block recursion
Definition: densevector.hh:651
constexpr FieldTraits< vt >::real_type infinity_norm() const
infinity norm (maximum of absolute values of entries)
Definition: densevector.hh:662
constexpr FieldTraits< vt >::real_type infinity_norm_real() const
simplified infinity norm (uses Manhattan norm for complex values)
Definition: densevector.hh:678
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 matrix with dynamic numbers of rows and columns.
Implements a matrix constructed from a given type representing a field and compile-time given number ...
Type traits to determine the type of reals (when working with complex numbers)
Implements a vector constructed from a given type representing a field and a compile-time given size.
Implements a generic iterator class for writing stl conformant iterators.
#define DUNE_ASSERT_BOUNDS(cond)
If DUNE_CHECK_BOUNDS is defined: check if condition cond holds; otherwise, do nothing.
Definition: boundschecking.hh:30
DiagonalMatrix< K, n > transposed() const
Return transposed of the matrix as DiagonalMatrix.
Definition: diagonalmatrix.hh:138
void mmhv(const X &x, Y &y) const
y -= A^H x
Definition: diagonalmatrix.hh:359
DiagonalMatrix & operator*=(const K &k)
vector space multiplication with scalar
Definition: diagonalmatrix.hh:248
std::size_t size_type
The type used for the index access and size operations.
Definition: diagonalmatrix.hh:70
size_type dim() const
dimension of the vector space
Definition: diagonalmatrix.hh:859
ConstIterator ConstRowIterator
rename the iterators for easier access
Definition: diagonalmatrix.hh:185
static constexpr int rows
The number of rows.
Definition: diagonalmatrix.hh:84
static constexpr size_type M()
number of blocks in column direction
Definition: diagonalmatrix.hh:522
FieldVector< K, n > & diagonal()
Get reference to diagonal vector.
Definition: diagonalmatrix.hh:583
void usmhv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A^H x
Definition: diagonalmatrix.hh:397
Iterator iterator
typedef for stl compliant access
Definition: diagonalmatrix.hh:947
static constexpr int blocklevel
The number of block levels we contain. This is the leaf, that is, 1.
Definition: diagonalmatrix.hh:73
K field_type
export the type representing the field
Definition: diagonalmatrix.hh:771
ConstIterator beforeEnd() const
Definition: diagonalmatrix.hh:832
const_row_type::ConstIterator ConstColIterator
rename the iterators for easier access
Definition: diagonalmatrix.hh:187
bool exists(size_type i, size_type j) const
return true when (i,j) is in pattern
Definition: diagonalmatrix.hh:532
ContainerWrapperIterator< const WrapperType, const_reference, const_reference > ConstIterator
Iterator class for sequential access.
Definition: diagonalmatrix.hh:181
DiagonalRowVector(K *p, int col)
Constructor making vector with identical coordinates.
Definition: diagonalmatrix.hh:924
K & diagonal(size_type i)
Get reference to diagonal entry.
Definition: diagonalmatrix.hh:571
void solve(V &x, const V &b) const
Solve system A x = b.
Definition: diagonalmatrix.hh:440
static constexpr size_type N()
number of blocks in row direction
Definition: diagonalmatrix.hh:516
const_reference operator[](size_type i) const
Return const_reference object as row replacement.
Definition: diagonalmatrix.hh:559
Iterator iterator
typedef for stl compliant access
Definition: diagonalmatrix.hh:147
ConstIterator begin() const
begin ConstIterator
Definition: diagonalmatrix.hh:819
ConstIterator const_iterator
typedef for stl compliant access
Definition: diagonalmatrix.hh:978
DiagonalMatrix & operator-=(const DiagonalMatrix &y)
vector space subtraction
Definition: diagonalmatrix.hh:227
DiagonalRowVectorConst(K *p, int col)
Constructor making vector with identical coordinates.
Definition: diagonalmatrix.hh:792
void mmtv(const X &x, Y &y) const
y -= A^T x
Definition: diagonalmatrix.hh:347
DiagonalMatrix(const K &k)
Constructor initializing the whole matrix with a scalar.
Definition: diagonalmatrix.hh:101
ContainerWrapperIterator< DiagonalRowVector< K, n >, K, K & > Iterator
Iterator class for sequential access.
Definition: diagonalmatrix.hh:945
void umtv(const X &x, Y &y) const
y += A^T x
Definition: diagonalmatrix.hh:311
ConstIterator const_iterator
typedef for stl compliant access
Definition: diagonalmatrix.hh:816
double infinity_norm_real() const
simplified infinity norm (uses Manhattan norm for complex values)
Definition: diagonalmatrix.hh:429
ContainerWrapperIterator< const WrapperType, reference, reference > Iterator
Iterator class for sequential access.
Definition: diagonalmatrix.hh:145
double frobenius_norm() const
frobenius norm: sqrt(sum over squared values of entries)
Definition: diagonalmatrix.hh:411
static constexpr int cols
The number of columns.
Definition: diagonalmatrix.hh:86
size_type rowIndex() const
index of this row in surrounding matrix
Definition: diagonalmatrix.hh:865
bool operator!=(const DiagonalMatrix &other) const
incomparison operator
Definition: diagonalmatrix.hh:270
ConstIterator begin() const
begin iterator
Definition: diagonalmatrix.hh:190
DiagonalMatrix & operator/=(const K &k)
vector space division by scalar
Definition: diagonalmatrix.hh:255
ConstIterator const_iterator
typedef for stl compliant access
Definition: diagonalmatrix.hh:183
bool identical(const DiagonalMatrix< K, n > &other) const
Check if matrix is the same object as the other matrix.
Definition: diagonalmatrix.hh:132
friend auto operator*(const DiagonalMatrix &matrixA, const DiagonalMatrix< OtherScalar, n > &matrixB)
Matrix-matrix multiplication.
Definition: diagonalmatrix.hh:470
DiagonalRowVector()
Constructor making uninitialized vector.
Definition: diagonalmatrix.hh:920
double frobenius_norm2() const
square of frobenius norm, need for block recursion
Definition: diagonalmatrix.hh:417
ContainerWrapperIterator< DiagonalRowVectorConst< K, n >, const K, const K & > ConstIterator
ConstIterator class for sequential access.
Definition: diagonalmatrix.hh:976
void usmtv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A^T x
Definition: diagonalmatrix.hh:384
const FieldVector< K, n > & diagonal() const
Get const reference to diagonal vector.
Definition: diagonalmatrix.hh:577
const K & diagonal(size_type i) const
Get const reference to diagonal entry.
Definition: diagonalmatrix.hh:565
size_type N() const
number of blocks in the vector (are of size 1 here)
Definition: diagonalmatrix.hh:853
DiagonalMatrix(std::initializer_list< K > const &l)
Construct diagonal matrix from an initializer list.
Definition: diagonalmatrix.hh:118
row_type::Iterator ColIterator
rename the iterators for easier access
Definition: diagonalmatrix.hh:151
K field_type
export the type representing the field
Definition: diagonalmatrix.hh:911
reference operator[](size_type i)
Return reference object as row replacement.
Definition: diagonalmatrix.hh:553
DiagonalMatrix(const FieldVector< K, n > &diag)
Constructor initializing the diagonal with a vector.
Definition: diagonalmatrix.hh:106
std::size_t size_type
The type used for the index access and size operation.
Definition: diagonalmatrix.hh:917
void usmv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A x
Definition: diagonalmatrix.hh:371
double infinity_norm() const
infinity norm (row sum norm, how to generalize for blocks?)
Definition: diagonalmatrix.hh:423
DiagonalMatrix & operator+=(const DiagonalMatrix &y)
vector space addition
Definition: diagonalmatrix.hh:220
K block_type
export the type representing the components
Definition: diagonalmatrix.hh:67
void umhv(const X &x, Y &y) const
y += A^H x
Definition: diagonalmatrix.hh:323
ConstIterator end() const
end ConstIterator
Definition: diagonalmatrix.hh:825
std::size_t size_type
The type used for the index access and size operation.
Definition: diagonalmatrix.hh:777
DiagonalMatrix & operator=(const K &k)
Assignment from a scalar.
Definition: diagonalmatrix.hh:125
DiagonalRowVectorConst()
Constructor making uninitialized vector.
Definition: diagonalmatrix.hh:786
friend std::ostream & operator<<(std::ostream &s, const DiagonalMatrix< K, n > &a)
Sends the matrix to an output stream.
Definition: diagonalmatrix.hh:542
K value_type
export the type representing the field
Definition: diagonalmatrix.hh:63
K block_type
export the type representing the components
Definition: diagonalmatrix.hh:774
K determinant() const
calculates the determinant of this matrix
Definition: diagonalmatrix.hh:455
ConstIterator beforeBegin() const
Definition: diagonalmatrix.hh:839
ContainerWrapperIterator< DiagonalRowVectorConst< K, n >, const K, const K & > ConstIterator
ConstIterator class for sequential access.
Definition: diagonalmatrix.hh:814
bool operator==(const DiagonalMatrix &other) const
comparison operator
Definition: diagonalmatrix.hh:264
DiagonalRowVector< K, n > row_type
Each row is implemented by a field vector.
Definition: diagonalmatrix.hh:76
Iterator RowIterator
rename the iterators for easier access
Definition: diagonalmatrix.hh:149
K block_type
export the type representing the components
Definition: diagonalmatrix.hh:914
const K & diagonal() const
the diagonal value
Definition: diagonalmatrix.hh:871
constexpr EnableIfInterOperable< T1, T2, bool >::type operator==(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for equality.
Definition: iteratorfacades.hh:238
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75
constexpr K conjugateComplex(const K &x)
compute conjugate complex of x
Definition: math.hh:164
you have to specialize this structure for any type that should be assignable to a DenseMatrix
Definition: densematrix.hh:61
get the 'mutable' version of a reference to a const object
Definition: genericiterator.hh:116
Traits for type conversions and type information.
