|
dune-common 2.12-git
|
Loading...
Searching...
No Matches
diagonalmatrix.hh
Go to the documentation of this file.
3// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
197 typedef ContainerWrapperIterator<const WrapperType, const_reference, const_reference> ConstIterator;
697 return DiagonalMatrix<typename PromotionTraits<K,OtherScalar>::PromotedType, 1>{matrixA.diagonal(0)*matrixB.diagonal(0)};
1078 class ContainerWrapperIterator : public BidirectionalIteratorFacade<ContainerWrapperIterator<CW,T,R>,T, R, int>
1082 friend class ContainerWrapperIterator<CW, typename mutable_reference<T>::type, typename mutable_reference<R>::type>;
1083 friend class ContainerWrapperIterator<CW, typename const_reference<T>::type, typename const_reference<R>::type>;
1085 typedef ContainerWrapperIterator<CW, typename mutable_reference<T>::type, typename mutable_reference<R>::type> MyType;
1086 typedef ContainerWrapperIterator<CW, typename const_reference<T>::type, typename const_reference<R>::type> MyConstType;
Implements a matrix constructed from a given type representing a field and compile-time given number ...
Macro for wrapping boundary checks.
Utilities for reduction like operations on ranges.
Type traits to determine the type of reals (when working with complex numbers)
Implements a generic iterator class for writing stl conformant iterators.
A few common exception classes.
This file implements a dense matrix with dynamic numbers of rows and columns.
Traits for type conversions and type information.
Implements a matrix constructed from a given type representing a field and a compile-time given numbe...
Implements a vector constructed from a given type representing a field and a compile-time given size.
#define DUNE_ASSERT_BOUNDS(cond)
If DUNE_CHECK_BOUNDS is defined: check if condition cond holds; otherwise, do nothing.
Definition boundschecking.hh:30
static constexpr IntegralRange< std::decay_t< T > > range(T &&from, U &&to) noexcept
free standing function for setting up a range based for loop over an integer range for (auto i: range...
Definition rangeutilities.hh:293
DiagonalMatrix< K, n > transposed() const
Return transposed of the matrix as DiagonalMatrix.
Definition diagonalmatrix.hh:154
void mmhv(const X &x, Y &y) const
y -= A^H x
Definition diagonalmatrix.hh:375
DiagonalMatrix & operator*=(const K &k)
vector space multiplication with scalar
Definition diagonalmatrix.hh:264
FieldTraits< K >::field_type field_type
Definition diagonalmatrix.hh:613
std::size_t size_type
The type used for the index access and size operations.
Definition diagonalmatrix.hh:72
size_type dim() const
dimension of the vector space
Definition diagonalmatrix.hh:881
ConstIterator ConstRowIterator
rename the iterators for easier access
Definition diagonalmatrix.hh:201
K & operator[](size_type i)
random access
Definition diagonalmatrix.hh:960
ContainerWrapperIterator & operator=(OtherContainerWrapperIteratorType &other)
Definition diagonalmatrix.hh:1118
static constexpr int rows
The number of rows.
Definition diagonalmatrix.hh:86
static constexpr size_type M()
number of blocks in column direction
Definition diagonalmatrix.hh:538
FieldVector< K, n > & diagonal()
Get reference to diagonal vector.
Definition diagonalmatrix.hh:599
void usmhv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A^H x
Definition diagonalmatrix.hh:413
Iterator iterator
typedef for stl compliant access
Definition diagonalmatrix.hh:969
static constexpr int blocklevel
The number of block levels we contain. This is the leaf, that is, 1.
Definition diagonalmatrix.hh:75
DiagonalRowVectorConst< K, n > type
Definition diagonalmatrix.hh:1038
static constexpr int size
The size of this vector.
Definition diagonalmatrix.hh:805
K field_type
export the type representing the field
Definition diagonalmatrix.hh:793
DiagonalRowVector< K, n > type
Definition diagonalmatrix.hh:1044
ConstIterator beforeEnd() const
Definition diagonalmatrix.hh:854
const_row_type::ConstIterator ConstColIterator
rename the iterators for easier access
Definition diagonalmatrix.hh:203
bool exists(size_type i, size_type j) const
return true when (i,j) is in pattern
Definition diagonalmatrix.hh:548
ContainerWrapperIterator< const WrapperType, const_reference, const_reference > ConstIterator
Iterator class for sequential access.
Definition diagonalmatrix.hh:197
const_row_type const_row_reference
Definition diagonalmatrix.hh:83
ContainerWrapperIterator(CW containerWrapper, int position)
Definition diagonalmatrix.hh:1096
DiagonalRowVector(K *p, int col)
Constructor making vector with identical coordinates.
Definition diagonalmatrix.hh:946
K & diagonal(size_type i)
Get reference to diagonal entry.
Definition diagonalmatrix.hh:587
void solve(V &x, const V &b) const
Solve system A x = b.
Definition diagonalmatrix.hh:456
static constexpr size_type N()
number of blocks in row direction
Definition diagonalmatrix.hh:532
ContainerWrapperIterator(OtherContainerWrapperIteratorType &other)
Definition diagonalmatrix.hh:1102
const_reference operator[](size_type i) const
Return const_reference object as row replacement.
Definition diagonalmatrix.hh:575
Iterator iterator
typedef for stl compliant access
Definition diagonalmatrix.hh:163
ConstIterator begin() const
begin ConstIterator
Definition diagonalmatrix.hh:841
ConstIterator const_iterator
typedef for stl compliant access
Definition diagonalmatrix.hh:1000
bool identical(const DiagonalRowVectorConst< K, n > &other) const
Definition diagonalmatrix.hh:830
DiagonalMatrix & operator-=(const DiagonalMatrix &y)
vector space subtraction
Definition diagonalmatrix.hh:243
DiagonalRowVectorConst(K *p, int col)
Constructor making vector with identical coordinates.
Definition diagonalmatrix.hh:814
void mmtv(const X &x, Y &y) const
y -= A^T x
Definition diagonalmatrix.hh:363
static constexpr int blocklevel
The number of block levels we contain.
Definition diagonalmatrix.hh:802
DiagonalMatrix(const K &k)
Constructor initializing the whole matrix with a scalar.
Definition diagonalmatrix.hh:103
ContainerWrapperIterator< DiagonalRowVector< K, n >, K, K & > Iterator
Iterator class for sequential access.
Definition diagonalmatrix.hh:967
std::ptrdiff_t distanceTo(OtherContainerWrapperIteratorType &other) const
Definition diagonalmatrix.hh:1171
void umtv(const X &x, Y &y) const
y += A^T x
Definition diagonalmatrix.hh:327
ConstIterator const_iterator
typedef for stl compliant access
Definition diagonalmatrix.hh:838
double infinity_norm_real() const
simplified infinity norm (uses Manhattan norm for complex values)
Definition diagonalmatrix.hh:445
DiagonalMatrixWrapper(const DiagonalMatrixType *mat)
Definition diagonalmatrix.hh:748
ContainerWrapperIterator< const WrapperType, reference, reference > Iterator
Iterator class for sequential access.
Definition diagonalmatrix.hh:161
DiagonalRowVector< K, n > type
Definition diagonalmatrix.hh:1050
double frobenius_norm() const
frobenius norm: sqrt(sum over squared values of entries)
Definition diagonalmatrix.hh:427
static void apply(DenseMatrix &denseMatrix, DiagonalMatrix< field, N > const &rhs)
Definition diagonalmatrix.hh:1189
static constexpr int cols
The number of columns.
Definition diagonalmatrix.hh:88
static constexpr int dimension
Definition diagonalmatrix.hh:786
size_type rowIndex() const
index of this row in surrounding matrix
Definition diagonalmatrix.hh:887
DiagonalRowVector & operator=(const K &k)
Assignment operator for scalar.
Definition diagonalmatrix.hh:951
bool operator!=(const DiagonalMatrix &other) const
incomparison operator
Definition diagonalmatrix.hh:286
ConstIterator begin() const
begin iterator
Definition diagonalmatrix.hh:206
DiagonalMatrix & operator/=(const K &k)
vector space division by scalar
Definition diagonalmatrix.hh:271
ConstIterator const_iterator
typedef for stl compliant access
Definition diagonalmatrix.hh:199
bool identical(const DiagonalMatrix< K, n > &other) const
Check if matrix is the same object as the other matrix.
Definition diagonalmatrix.hh:148
friend auto operator*(const DiagonalMatrix &matrixA, const DiagonalMatrix< OtherScalar, n > &matrixB)
Matrix-matrix multiplication.
Definition diagonalmatrix.hh:486
size_type realIndex(int i) const
Definition diagonalmatrix.hh:752
const K & operator[](size_type i) const
same for read only access
Definition diagonalmatrix.hh:822
DiagonalRowVector()
Constructor making uninitialized vector.
Definition diagonalmatrix.hh:942
DiagonalRowVectorConst * operator&()
Definition diagonalmatrix.hh:910
bool operator==(const DiagonalRowVectorConst &y) const
Binary vector comparison.
Definition diagonalmatrix.hh:867
double frobenius_norm2() const
square of frobenius norm, need for block recursion
Definition diagonalmatrix.hh:433
ContainerWrapperIterator< DiagonalRowVectorConst< K, n >, const K, const K & > ConstIterator
ConstIterator class for sequential access.
Definition diagonalmatrix.hh:998
bool identical(const DiagonalMatrixWrapper &other) const
Definition diagonalmatrix.hh:763
void usmtv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A^T x
Definition diagonalmatrix.hh:400
const FieldVector< K, n > & diagonal() const
Get const reference to diagonal vector.
Definition diagonalmatrix.hh:593
const K & diagonal(size_type i) const
Get const reference to diagonal entry.
Definition diagonalmatrix.hh:581
size_type N() const
number of blocks in the vector (are of size 1 here)
Definition diagonalmatrix.hh:875
DiagonalMatrix(std::initializer_list< K > const &l)
Construct diagonal matrix from an initializer list.
Definition diagonalmatrix.hh:120
row_type::Iterator ColIterator
rename the iterators for easier access
Definition diagonalmatrix.hh:167
K field_type
export the type representing the field
Definition diagonalmatrix.hh:933
reference operator[](size_type i)
Return reference object as row replacement.
Definition diagonalmatrix.hh:569
DiagonalRowVectorConst< K, n > type
Definition diagonalmatrix.hh:1032
DiagonalMatrix(const FieldVector< K, n > &diag)
Constructor initializing the diagonal with a vector.
Definition diagonalmatrix.hh:108
std::size_t size_type
The type used for the index access and size operation.
Definition diagonalmatrix.hh:939
void usmv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A x
Definition diagonalmatrix.hh:387
double infinity_norm() const
infinity norm (row sum norm, how to generalize for blocks?)
Definition diagonalmatrix.hh:439
DiagonalMatrix & operator+=(const DiagonalMatrix &y)
vector space addition
Definition diagonalmatrix.hh:236
K block_type
export the type representing the components
Definition diagonalmatrix.hh:69
void umhv(const X &x, Y &y) const
y += A^H x
Definition diagonalmatrix.hh:339
ContainerWrapperIterator(const MyType &other)
Definition diagonalmatrix.hh:1107
ConstIterator end() const
end ConstIterator
Definition diagonalmatrix.hh:847
std::size_t size_type
The type used for the index access and size operation.
Definition diagonalmatrix.hh:799
DiagonalMatrix & operator=(const K &k)
Assignment from a scalar.
Definition diagonalmatrix.hh:133
DiagonalRowVectorConst()
Constructor making uninitialized vector.
Definition diagonalmatrix.hh:808
size_type realIndex(int i) const
Definition diagonalmatrix.hh:900
friend std::ostream & operator<<(std::ostream &s, const DiagonalMatrix< K, n > &a)
Sends the matrix to an output stream.
Definition diagonalmatrix.hh:558
K value_type
export the type representing the field
Definition diagonalmatrix.hh:65
K block_type
export the type representing the components
Definition diagonalmatrix.hh:796
K determinant() const
calculates the determinant of this matrix
Definition diagonalmatrix.hh:471
FieldTraits< K >::real_type real_type
Definition diagonalmatrix.hh:614
ConstIterator beforeBegin() const
Definition diagonalmatrix.hh:861
DiagonalMatrixWrapper()
Definition diagonalmatrix.hh:744
ContainerWrapperIterator< DiagonalRowVectorConst< K, n >, const K, const K & > ConstIterator
ConstIterator class for sequential access.
Definition diagonalmatrix.hh:836
bool operator==(const DiagonalMatrix &other) const
comparison operator
Definition diagonalmatrix.hh:280
DiagonalRowVectorConst< K, n > const_row_type
Definition diagonalmatrix.hh:81
DiagonalRowVector< K, n > row_type
Each row is implemented by a field vector.
Definition diagonalmatrix.hh:78
bool equals(const MyType &other) const
Definition diagonalmatrix.hh:1133
Iterator RowIterator
rename the iterators for easier access
Definition diagonalmatrix.hh:165
K block_type
export the type representing the components
Definition diagonalmatrix.hh:936
DiagonalMatrix(const DiagonalMatrix< OtherK, n > &other)
Converting constructor.
Definition diagonalmatrix.hh:128
const K & diagonal() const
the diagonal value
Definition diagonalmatrix.hh:893
constexpr K conjugateComplex(const K &x)
compute conjugate complex of x
Definition math.hh:146
you have to specialize this structure for any type that should be assignable to a DenseMatrix
Definition densematrix.hh:61
constexpr FieldTraits< value_type >::real_type two_norm() const
two norm sqrt(sum over squared values of entries)
Definition densevector.hh:656
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:665
constexpr FieldTraits< vt >::real_type infinity_norm() const
infinity norm (maximum of absolute values of entries)
Definition densevector.hh:676
constexpr FieldTraits< vt >::real_type infinity_norm_real() const
simplified infinity norm (uses Manhattan norm for complex values)
Definition densevector.hh:692
Definition diagonalmatrix.hh:779
Definition diagonalmatrix.hh:922
Definition diagonalmatrix.hh:731
Iterator class for sparse vector-like containers.
Definition diagonalmatrix.hh:1079
ContainerWrapperIterator(const MyConstType &other)
Definition diagonalmatrix.hh:1112
bool equals(const MyConstType &other) const
Definition diagonalmatrix.hh:1138
TMP to check the shape of a DenseMatrix statically, if possible.
Definition fmatrix.hh:121
Definition ftraits.hh:26
T field_type
export the type representing the field
Definition ftraits.hh:28
T real_type
export the type representing the real type of the field
Definition ftraits.hh:30
Get the 'const' version of a reference to a mutable object.
Definition genericiterator.hh:87
get the 'mutable' version of a reference to a const object
Definition genericiterator.hh:116
Facade class for stl conformant bidirectional iterators.
Definition iteratorfacades.hh:275
decltype(std::declval< T1 >()+std::declval< T2 >()) PromotedType
Definition promotiontraits.hh:28
T begin(T... args)
T copy_n(T... args)
T endl(T... args)
T size(T... args)
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8