Dune Core Modules (unstable)
multitypeblockvector.hh
1 // SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
82 using field_type = Std::detected_t<std::common_type_t, typename FieldTraits< std::decay_t<Args> >::field_type...>;
84 // make sure that we have an std::common_type: using an assertion produces a more readable error message
87 "No std::common_type implemented for the given field_types of the Args. Please provide an implementation and check that a FieldTraits class is present for your type.");
149 operator[] ([[maybe_unused]] const std::integral_constant< size_type, index > indexVariable) const
219 return accumulate(*this, typename FieldTraits<field_type>::real_type(0), [&](auto&& a, auto&& entry) {
228 return accumulate(*this, typename FieldTraits<field_type>::real_type(0), [&](auto&& a, auto&& entry) {
237 return accumulate(*this, typename FieldTraits<field_type>::real_type(0), [&](auto&& a, auto&& entry) {
A Vector class to support different block types.
Definition: multitypeblockvector.hh:59
Provides the functions dot(a,b) := and dotT(a,b) := .
Type traits to determine the type of reals (when working with complex numbers)
typename detected_or< nonesuch, Op, Args... >::type detected_t
Returns Op<Args...> if that is valid; otherwise returns nonesuch.
Definition: type_traits.hh:173
constexpr void forEach(Range &&range, F &&f)
Range based for loop.
Definition: hybridutilities.hh:256
constexpr auto max
Function object that returns the greater of the given values.
Definition: hybridutilities.hh:484
constexpr auto integralRange(const Begin &begin, const End &end)
Create an integral range.
Definition: hybridutilities.hh:172
constexpr T accumulate(Range &&range, T value, F &&f)
Accumulate values.
Definition: hybridutilities.hh:279
void operator=(const T &newval)
Assignment operator.
Definition: multitypeblockvector.hh:157
std::size_t size_type
Type used for vector sizes.
Definition: multitypeblockvector.hh:65
static constexpr size_type N()
Number of elements.
Definition: multitypeblockvector.hh:102
Std::detected_t< std::common_type_t, typename FieldTraits< std::decay_t< Args > >::field_type... > field_type
The type used for scalars.
Definition: multitypeblockvector.hh:82
static constexpr size_type size()
Return the number of non-zero vector entries.
Definition: multitypeblockvector.hh:95
std::tuple_element< index, TupleType >::type & operator[]([[maybe_unused]] const std::integral_constant< size_type, index > indexVariable)
Random-access operator.
Definition: multitypeblockvector.hh:137
size_type dim() const
Number of scalar elements.
Definition: multitypeblockvector.hh:108
void operator*=(const T &w)
Multiplication with a scalar.
Definition: multitypeblockvector.hh:186
void axpy(const Ta &a, const type &y)
Axpy operation on this vector (*this += a * y)
Definition: multitypeblockvector.hh:313
void operator/=(const T &w)
Division by a scalar.
Definition: multitypeblockvector.hh:195
MultiTypeBlockVector< Args... > type
Definition: multitypeblockvector.hh:75
auto one_norm() const
Compute the 1-norm.
Definition: multitypeblockvector.hh:217
void operator-=(const type &newv)
Definition: multitypeblockvector.hh:176
FieldTraits< field_type >::real_type infinity_norm_real() const
Compute the simplified maximum norm (uses 1-norm for complex values)
Definition: multitypeblockvector.hh:279
FieldTraits< field_type >::real_type infinity_norm() const
Compute the maximum norm.
Definition: multitypeblockvector.hh:248
void operator+=(const type &newv)
Definition: multitypeblockvector.hh:166
FieldTraits< field_type >::real_type two_norm2() const
Compute the squared Euclidean norm.
Definition: multitypeblockvector.hh:235
FieldTraits< field_type >::real_type two_norm() const
Compute the Euclidean norm.
Definition: multitypeblockvector.hh:244
auto one_norm_real() const
Compute the simplified 1-norm (uses 1-norm also for complex values)
Definition: multitypeblockvector.hh:226
Simple iterative methods like Jacobi, Gauss-Seidel, SOR, SSOR, etc. in a generic way.
Traits for type conversions and type information.
|
Legal Statements / Impressum |
Hosted by TU Dresden |
generated with Hugo v0.80.0
(Apr 27, 22:29, 2024)