|
dune-common 2.12-git
|
Loading...
Searching...
No Matches
densevector.hh
Go to the documentation of this file.
3// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
28 typedef typename FieldTraits< typename DenseMatVecTraits<V>::value_type >::field_type field_type;
133 friend class DenseIterator<typename std::remove_const<C>::type, typename std::remove_const<T>::type, typename mutable_reference<R>::type >;
134 friend class DenseIterator<const typename std::remove_const<C>::type, const typename std::remove_const<T>::type, typename const_reference<R>::type >;
136 typedef DenseIterator<typename std::remove_const<C>::type, typename std::remove_const<T>::type, typename mutable_reference<R>::type > MutableIterator;
137 typedef DenseIterator<const typename std::remove_const<C>::type, const typename std::remove_const<T>::type, typename const_reference<R>::type > ConstIterator;
215 constexpr DifferenceType distanceTo(DenseIterator<const typename std::remove_const<C>::type,const typename std::remove_const<T>::type> other) const
218 return static_cast< DifferenceType >( other.position_ ) - static_cast< DifferenceType >( position_ );
221 constexpr DifferenceType distanceTo(DenseIterator<typename std::remove_const<C>::type, typename std::remove_const<T>::type> other) const
224 return static_cast< DifferenceType >( other.position_ ) - static_cast< DifferenceType >( position_ );
606 constexpr typename PromotionTraits<field_type,typename DenseVector<Other>::field_type>::PromotedType operator* (const DenseVector<Other>& x) const {
607 typedef typename PromotionTraits<field_type, typename DenseVector<Other>::field_type>::PromotedType PromotedType;
624 constexpr typename PromotionTraits<field_type,typename DenseVector<Other>::field_type>::PromotedType dot(const DenseVector<Other>& x) const {
625 typedef typename PromotionTraits<field_type, typename DenseVector<Other>::field_type>::PromotedType PromotedType;
Macro for wrapping boundary checks.
Type traits to determine the type of reals (when working with complex numbers)
Implements a generic iterator class for writing stl conformant iterators.
Documentation of the traits classes you need to write for each implementation of DenseVector or Dense...
Compute type of the result of an arithmetic operation involving two different number types.
Provides the functions dot(a,b) := and dotT(a,b) := .
#define DUNE_ASSERT_BOUNDS(cond)
If DUNE_CHECK_BOUNDS is defined: check if condition cond holds; otherwise, do nothing.
Definition boundschecking.hh:30
auto dot(const A &a, const B &b) -> typename std::enable_if< IsNumber< A >::value &&!IsVector< A >::value &&!std::is_same< typename FieldTraits< A >::field_type, typename FieldTraits< A >::real_type > ::value, decltype(conj(a) *b)>::type
computes the dot product for fundamental data types according to Petsc's VectDot function: dot(a,...
Definition dotproduct.hh:40
std::ostream & operator<<(std::ostream &s, const bigunsignedint< k > &x)
Definition bigunsignedint.hh:301
STL namespace.
Interface for a class of dense vectors over a given field.
Definition densevector.hh:244
Traits::value_type value_type
export the type representing the field
Definition densevector.hh:265
constexpr derived_type operator-() const
Vector negation.
Definition densevector.hh:469
constexpr const value_type & front() const
return reference to first element
Definition densevector.hh:327
ConstIterator const_iterator
typedef for stl compliant access
Definition densevector.hh:396
constexpr const value_type & back() const
return reference to last element
Definition densevector.hh:339
Iterator iterator
typedef for stl compliant access
Definition densevector.hh:359
constexpr size_type N() const
number of blocks in the vector (are of size 1 here)
Definition densevector.hh:742
constexpr bool empty() const
checks whether the container is empty
Definition densevector.hh:345
constexpr std::enable_if< std::is_convertible< FieldType, field_type >::value, derived_type >::type & operator*=(const FieldType &kk)
vector space multiplication with scalar
Definition densevector.hh:538
DenseIterator< const DenseVector, const value_type > ConstIterator
ConstIterator class for sequential access.
Definition densevector.hh:394
constexpr FieldTraits< value_type >::real_type two_norm() const
two norm sqrt(sum over squared values of entries)
Definition densevector.hh:656
constexpr derived_type & axpy(const field_type &a, const DenseVector< Other > &x)
vector space axpy operation ( *this += a x )
Definition densevector.hh:590
Traits::derived_type derived_type
type of derived vector class
Definition densevector.hh:262
constexpr DenseVector & operator=(const DenseVector &)=default
Assignment operator for other DenseVector of same type.
constexpr derived_type & operator+=(const DenseVector< Other > &x)
vector space addition
Definition densevector.hh:434
constexpr derived_type operator+(const DenseVector< Other > &b) const
Binary vector addition.
Definition densevector.hh:454
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
static constexpr int blocklevel
The number of block levels we contain. This is the leaf, that is, 1.
Definition densevector.hh:277
constexpr bool operator!=(const DenseVector< Other > &x) const
Binary vector incomparison.
Definition densevector.hh:582
Traits::size_type size_type
The type used for the index access and size operation.
Definition densevector.hh:274
DenseIterator< DenseVector, value_type > Iterator
Iterator class for sequential access.
Definition densevector.hh:357
constexpr ConstIterator begin() const
begin ConstIterator
Definition densevector.hh:399
constexpr std::enable_if< std::is_convertible< FieldType, field_type >::value, derived_type >::type & operator/=(const FieldType &kk)
vector space division by scalar
Definition densevector.hh:560
constexpr ConstIterator end() const
end ConstIterator
Definition densevector.hh:405
constexpr size_type dim() const
dimension of the vector space
Definition densevector.hh:748
constexpr FieldTraits< vt >::real_type infinity_norm() const
infinity norm (maximum of absolute values of entries)
Definition densevector.hh:676
constexpr derived_type & operator-=(const DenseVector< Other > &x)
vector space subtraction
Definition densevector.hh:444
constexpr DenseVector()=default
constexpr value_type & back()
return reference to last element
Definition densevector.hh:333
constexpr derived_type & operator=(const value_type &k)
Assignment operator for scalar.
Definition densevector.hh:281
constexpr FieldTraits< value_type >::real_type one_norm_real() const
simplified one norm (uses Manhattan norm for complex values)
Definition densevector.hh:647
Traits::value_type block_type
export the type representing the components
Definition densevector.hh:271
constexpr Iterator find(size_type i)
return iterator to given element or end()
Definition densevector.hh:388
constexpr FieldTraits< vt >::real_type infinity_norm_real() const
simplified infinity norm (uses Manhattan norm for complex values)
Definition densevector.hh:692
FieldTraits< value_type >::field_type field_type
export the type representing the field
Definition densevector.hh:268
constexpr DenseVector(const DenseVector &)=default
constexpr bool operator==(const DenseVector< Other > &x) const
Binary vector comparison.
Definition densevector.hh:570
constexpr ConstIterator beforeBegin() const
Definition densevector.hh:419
constexpr FieldTraits< value_type >::real_type one_norm() const
one norm (sum over absolute values of entries)
Definition densevector.hh:637
constexpr PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType operator*(const DenseVector< Other > &x) const
indefinite vector dot product which corresponds to Petsc's VecTDot
Definition densevector.hh:606
constexpr PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType dot(const DenseVector< Other > &x) const
vector dot product which corresponds to Petsc's VecDot
Definition densevector.hh:624
constexpr ConstIterator find(size_type i) const
return iterator to given element or end()
Definition densevector.hh:425
constexpr value_type & front()
return reference to first element
Definition densevector.hh:321
constexpr value_type & operator[](size_type i)
random access
Definition densevector.hh:310
FieldTraits< typenameDenseMatVecTraits< V >::value_type >::real_type real_type
Definition densevector.hh:29
FieldTraits< typenameDenseMatVecTraits< V >::value_type >::field_type field_type
Definition densevector.hh:28
Generic iterator class for dense vector and matrix implementations.
Definition densevector.hh:132
constexpr R elementAt(DifferenceType i) const
Definition densevector.hh:207
constexpr DenseIterator(const MutableIterator &other)
Definition densevector.hh:159
constexpr DifferenceType distanceTo(DenseIterator< typename std::remove_const< C >::type, typename std::remove_const< T >::type > other) const
Definition densevector.hh:221
constexpr DenseIterator(const ConstIterator &other)
Definition densevector.hh:164
constexpr DenseIterator & operator=(const ConstIterator &other)
Definition densevector.hh:169
constexpr bool equals(const MutableIterator &other) const
Definition densevector.hh:182
constexpr bool equals(const ConstIterator &other) const
Definition densevector.hh:188
constexpr DifferenceType distanceTo(DenseIterator< const typename std::remove_const< C >::type, const typename std::remove_const< T >::type > other) const
Definition densevector.hh:215
constexpr DenseIterator(C &cont, SizeType pos)
Definition densevector.hh:155
C::size_type SizeType
The type to index the underlying container.
Definition densevector.hh:148
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 'mutable' version of a reference to a const object
Definition genericiterator.hh:116
Base class for stl conformant forward iterators.
Definition iteratorfacades.hh:435
Definition matvectraits.hh:31
Compute type of the result of an arithmetic operation involving two different number types.
Definition promotiontraits.hh:27
T imag(T... args)
T max(T... args)
T min(T... args)
T real(T... args)
T sqrt(T... args)
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8