DUNE-FEM (unstable)
vector space out of a tensor product of fields. More...
#include <dune/common/fvector.hh>
Public Types | |
using | size_type = typename Base::size_type |
The type used for the index access and size operation. | |
using | value_type = typename Base::value_type |
The type of the elements stored in the vector. | |
using | reference = value_type & |
The type used for references to the vector entries. | |
using | const_reference = const value_type & |
The type used for const references to the vector entries. | |
typedef Traits::derived_type | derived_type |
type of derived vector class | |
typedef FieldTraits< value_type >::field_type | field_type |
export the type representing the field | |
typedef Traits::value_type | block_type |
export the type representing the components | |
typedef DenseIterator< DenseVector, value_type > | Iterator |
Iterator class for sequential access. | |
typedef Iterator | iterator |
typedef for stl compliant access | |
typedef DenseIterator< const DenseVector, const value_type > | ConstIterator |
ConstIterator class for sequential access. | |
typedef ConstIterator | const_iterator |
typedef for stl compliant access | |
Public Member Functions | |
constexpr | FieldVector () noexcept(std::is_nothrow_default_constructible_v< K >) |
Default constructor, making value-initialized vector with all components set to zero. | |
explicit (SIZE !=1) const expr FieldVector(const value_type &value) noexcept | |
Constructor with a given value initializing all entries to this value. | |
template<Concept::Number S> requires (std::constructible_from<K,S>) | |
explicit (SIZE !=1) const expr FieldVector(const S &scalar) noexcept(std::is_nothrow_constructible_v< K, S >) | |
Constructor with a given scalar initializing all entries to this value. | |
constexpr | FieldVector (const std::initializer_list< K > &l) |
Construct from a std::initializer_list of values. | |
template<class V > requires (IsFieldVectorSizeCorrect<V,SIZE>::value && std::is_assignable_v<K&, decltype(std::declval<const V&>()[0])>) | |
constexpr | FieldVector (const DenseVector< V > &x) |
Constructor from another dense vector if the elements are assignable to K. | |
template<class OtherK > requires (std::is_assignable_v<K&, const OtherK&>) | |
constexpr | FieldVector (const FieldVector< OtherK, SIZE > &x) noexcept(std::is_nothrow_assignable_v< K &, const OtherK & >) |
Converting constructor from FieldVector with different element type. | |
constexpr | FieldVector (const FieldVector &)=default |
Copy constructor with default behavior. | |
template<class V > requires (IsFieldVectorSizeCorrect<V,SIZE>::value && std::is_assignable_v<K&, decltype(std::declval<const V&>()[0])>) | |
constexpr FieldVector & | operator= (const DenseVector< V > &x) |
Assignment from another dense vector. | |
template<Concept::Number S> requires std::constructible_from<K,S> | |
constexpr FieldVector & | operator= (const S &scalar) noexcept(std::is_nothrow_constructible_v< K, S >) |
Assignment operator from scalar. | |
template<class OtherK > requires (std::is_assignable_v<K&, const OtherK&>) | |
constexpr FieldVector & | operator= (const FieldVector< OtherK, SIZE > &x) noexcept(std::is_nothrow_assignable_v< K &, const OtherK & >) |
Converting assignment operator from FieldVector with different element type. | |
constexpr FieldVector & | operator= (const FieldVector &)=default |
Copy assignment operator with default behavior. | |
constexpr value_type & | front () |
return reference to first element | |
constexpr const value_type & | front () const |
return reference to first element | |
constexpr value_type & | back () |
return reference to last element | |
constexpr const value_type & | back () const |
return reference to last element | |
constexpr bool | empty () const |
checks whether the container is empty | |
constexpr size_type | size () const |
size method | |
constexpr Iterator | begin () |
begin iterator | |
constexpr ConstIterator | begin () const |
begin ConstIterator | |
constexpr Iterator | end () |
end iterator | |
constexpr ConstIterator | end () const |
end ConstIterator | |
constexpr Iterator | beforeEnd () |
constexpr ConstIterator | beforeEnd () const |
constexpr Iterator | beforeBegin () |
constexpr ConstIterator | beforeBegin () const |
constexpr Iterator | find (size_type i) |
return iterator to given element or end() | |
constexpr ConstIterator | find (size_type i) const |
return iterator to given element or end() | |
constexpr derived_type & | operator+= (const DenseVector< Other > &x) |
vector space addition | |
constexpr std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & | operator+= (const ValueType &kk) |
vector space add scalar to all comps More... | |
constexpr derived_type & | operator-= (const DenseVector< Other > &x) |
vector space subtraction | |
constexpr std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & | operator-= (const ValueType &kk) |
vector space subtract scalar from all comps More... | |
constexpr derived_type | operator+ (const DenseVector< Other > &b) const |
Binary vector addition. | |
constexpr derived_type | operator- (const DenseVector< Other > &b) const |
Binary vector subtraction. | |
constexpr derived_type | operator- () const |
Vector negation. | |
constexpr std::enable_if< std::is_convertible< FieldType, field_type >::value, derived_type >::type & | operator*= (const FieldType &kk) |
vector space multiplication with scalar More... | |
constexpr std::enable_if< std::is_convertible< FieldType, field_type >::value, derived_type >::type & | operator/= (const FieldType &kk) |
vector space division by scalar More... | |
constexpr bool | operator== (const DenseVector< Other > &x) const |
Binary vector comparison. | |
constexpr bool | operator!= (const DenseVector< Other > &x) const |
Binary vector incomparison. | |
constexpr derived_type & | axpy (const field_type &a, const DenseVector< Other > &x) |
vector space axpy operation ( *this += a x ) | |
constexpr PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType | operator* (const DenseVector< Other > &x) const |
indefinite vector dot product \(\left (x^T \cdot y \right)\) which corresponds to Petsc's VecTDot More... | |
constexpr PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType | dot (const DenseVector< Other > &x) const |
vector dot product \(\left (x^H \cdot y \right)\) which corresponds to Petsc's VecDot More... | |
constexpr FieldTraits< value_type >::real_type | one_norm () const |
one norm (sum over absolute values of entries) | |
constexpr FieldTraits< value_type >::real_type | one_norm_real () const |
simplified one norm (uses Manhattan norm for complex values) | |
constexpr FieldTraits< value_type >::real_type | two_norm () const |
two norm sqrt(sum over squared values of entries) | |
constexpr FieldTraits< value_type >::real_type | two_norm2 () const |
square of two norm (sum over squared values of entries), need for block recursion | |
constexpr FieldTraits< vt >::real_type | infinity_norm () const |
infinity norm (maximum of absolute values of entries) | |
constexpr FieldTraits< vt >::real_type | infinity_norm () const |
infinity norm (maximum of absolute values of entries) | |
constexpr FieldTraits< vt >::real_type | infinity_norm_real () const |
simplified infinity norm (uses Manhattan norm for complex values) | |
constexpr FieldTraits< vt >::real_type | infinity_norm_real () const |
simplified infinity norm (uses Manhattan norm for complex values) | |
constexpr size_type | N () const |
number of blocks in the vector (are of size 1 here) | |
constexpr size_type | dim () const |
dimension of the vector space | |
Element access | |
constexpr reference | operator[] (size_type i) |
Return a reference to the i th element. More... | |
constexpr const_reference | operator[] (size_type i) const |
Return a (const) reference to the i th element. More... | |
constexpr K * | data () noexcept |
Return pointer to underlying array. | |
constexpr const K * | data () const noexcept |
Return pointer to underlying array. | |
constexpr | operator const_reference () const noexcept |
Conversion operator. | |
constexpr | operator reference () noexcept |
Conversion operator. | |
Static Public Member Functions | |
Capacity | |
static constexpr size_type | size () noexcept |
Obtain the number of elements stored in the vector. | |
Static Public Attributes | |
static constexpr int | dimension = SIZE |
The size of this vector. | |
static constexpr int | blocklevel |
The number of block levels we contain. This is the leaf, that is, 1. | |
Related Functions | |
(Note that these are not member functions.) | |
template<class K , int SIZE> | |
std::istream & | operator>> (std::istream &in, FieldVector< K, SIZE > &v) |
Read a FieldVector from an input stream. More... | |
std::ostream & | operator<< (std::ostream &s, const DenseVector< FieldVector< K, SIZE > > &v) |
Write a DenseVector to an output stream. More... | |
Detailed Description
class Dune::FieldVector< K, SIZE >
vector space out of a tensor product of fields.
- Template Parameters
-
K the field type (use float, double, complex, etc) SIZE number of components.
- Examples
- recipe-integration.cc, and recipe-iterate-over-grid.cc.
Member Function Documentation
◆ beforeBegin() [1/2]
|
inlineconstexprinherited |
- Returns
- an iterator that is positioned before the first entry of the vector.
◆ beforeBegin() [2/2]
|
inlineconstexprinherited |
- Returns
- an iterator that is positioned before the first entry of the vector.
◆ beforeEnd() [1/2]
|
inlineconstexprinherited |
- Returns
- an iterator that is positioned before the end iterator of the vector, i.e. at the last entry.
◆ beforeEnd() [2/2]
|
inlineconstexprinherited |
- Returns
- an iterator that is positioned before the end iterator of the vector. i.e. at the last element
◆ dot()
|
inlineconstexprinherited |
vector dot product \(\left (x^H \cdot y \right)\) which corresponds to Petsc's VecDot
http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecDot.html
- Parameters
-
x other vector
- Returns
◆ operator*()
|
inlineconstexprinherited |
indefinite vector dot product \(\left (x^T \cdot y \right)\) which corresponds to Petsc's VecTDot
http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecTDot.html
- Parameters
-
x other vector
- Returns
◆ operator*=()
|
inlineconstexprinherited |
vector space multiplication with scalar
we use enable_if to avoid an ambiguity, if the function parameter can be converted to field_type implicitly. (see FS#1457)
The function is only enabled, if the parameter is directly convertible to field_type.
◆ operator+=()
|
inlineconstexprinherited |
vector space add scalar to all comps
we use enable_if to avoid an ambiguity, if the function parameter can be converted to value_type implicitly. (see FS#1457)
The function is only enabled, if the parameter is directly convertible to value_type.
◆ operator-=()
|
inlineconstexprinherited |
vector space subtract scalar from all comps
we use enable_if to avoid an ambiguity, if the function parameter can be converted to value_type implicitly. (see FS#1457)
The function is only enabled, if the parameter is directly convertible to value_type.
◆ operator/=()
|
inlineconstexprinherited |
vector space division by scalar
we use enable_if to avoid an ambiguity, if the function parameter can be converted to field_type implicitly. (see FS#1457)
The function is only enabled, if the parameter is directly convertible to field_type.
◆ operator[]() [1/2]
|
inlineconstexpr |
Return a reference to the i
th element.
- Exceptions
-
RangeError if index i
is out of range[0,SIZE)
(only checked if DUNE_CHECK_BOUNDS is defined).
References DUNE_ASSERT_BOUNDS, and Dune::FieldVector< K, SIZE >::size().
◆ operator[]() [2/2]
|
inlineconstexpr |
Return a (const) reference to the i
th element.
- Exceptions
-
RangeError if index i
is out of range[0,SIZE)
(only checked if DUNE_CHECK_BOUNDS is defined).
References DUNE_ASSERT_BOUNDS, and Dune::FieldVector< K, SIZE >::size().
Friends And Related Function Documentation
◆ operator<<()
|
related |
Write a DenseVector to an output stream.
- Parameters
-
[in] s std :: ostream to write to [in] v DenseVector to write
- Returns
- the output stream (s)
The documentation for this class was generated from the following files:
- dune/common/densematrix.hh
- dune/common/fvector.hh
