|
dune-common 2.10
|
Construct a vector with a dynamic size. More...
#include <dune/common/dynvector.hh>

Public Types | |
| typedef Base::size_type | size_type |
| typedef Base::value_type | value_type |
| typedef std::vector< K, Allocator > | container_type |
| typedef Allocator | allocator_type |
| 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 | |
| DynamicVector (const allocator_type &a=allocator_type()) | |
| Constructor making uninitialized vector. | |
| DynamicVector (size_type n, const allocator_type &a=allocator_type()) | |
| DynamicVector (size_type n, value_type c, const allocator_type &a=allocator_type()) | |
| Constructor making vector with identical coordinates. | |
| DynamicVector (std::initializer_list< K > const &l) | |
| Construct from a std::initializer_list. | |
| DynamicVector (const DynamicVector &x) | |
| Constructor making vector with identical coordinates. | |
| DynamicVector (DynamicVector &&x) | |
| Move constructor. | |
| template<class T > | |
| DynamicVector (const DynamicVector< T, Allocator > &x) | |
| template<class X > | |
| DynamicVector (const DenseVector< X > &x, const allocator_type &a=allocator_type()) | |
| Copy constructor from another DenseVector. | |
| DynamicVector & | operator= (const DynamicVector &other) |
| Copy assignment operator. | |
| DynamicVector & | operator= (DynamicVector &&other) |
| Move assignment operator. | |
| size_type | capacity () const |
| Number of elements for which memory has been allocated. | |
| void | resize (size_type n, value_type c=value_type()) |
| void | reserve (size_type n) |
| size_type | size () const |
| K & | operator[] (size_type i) |
| const K & | operator[] (size_type i) const |
| K * | data () noexcept |
| return pointer to underlying array | |
| const K * | data () const noexcept |
| return pointer to underlying array | |
| const container_type & | container () const |
| container_type & | container () |
| derived_type & | operator= (const value_type &k) |
| Assignment operator for scalar. | |
| DenseVector & | operator= (const DenseVector &)=default |
| Assignment operator for other DenseVector of same type. | |
| template<typename W , std::enable_if_t< std::is_assignable< value_type &, typename DenseVector< W >::value_type >::value, int > = 0> | |
| derived_type & | operator= (const DenseVector< W > &other) |
| Assignment operator for other DenseVector of different type. | |
| value_type & | front () |
| return reference to first element | |
| const value_type & | front () const |
| return reference to first element | |
| value_type & | back () |
| return reference to last element | |
| const value_type & | back () const |
| return reference to last element | |
| bool | empty () const |
| checks whether the container is empty | |
| Iterator | begin () |
| begin iterator | |
| ConstIterator | begin () const |
| begin ConstIterator | |
| Iterator | end () |
| end iterator | |
| ConstIterator | end () const |
| end ConstIterator | |
| Iterator | beforeEnd () |
| ConstIterator | beforeEnd () const |
| Iterator | beforeBegin () |
| ConstIterator | beforeBegin () const |
| Iterator | find (size_type i) |
| return iterator to given element or end() | |
| ConstIterator | find (size_type i) const |
| return iterator to given element or end() | |
| template<class Other > | |
| derived_type & | operator+= (const DenseVector< Other > &x) |
| vector space addition | |
| template<typename ValueType > | |
| std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & | operator+= (const ValueType &kk) |
| vector space add scalar to all comps | |
| template<class Other > | |
| derived_type & | operator-= (const DenseVector< Other > &x) |
| vector space subtraction | |
| template<typename ValueType > | |
| std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & | operator-= (const ValueType &kk) |
| vector space subtract scalar from all comps | |
| template<class Other > | |
| derived_type | operator+ (const DenseVector< Other > &b) const |
| Binary vector addition. | |
| template<class Other > | |
| derived_type | operator- (const DenseVector< Other > &b) const |
| Binary vector subtraction. | |
| derived_type | operator- () const |
| Vector negation. | |
| template<typename FieldType > | |
| std::enable_if< std::is_convertible< FieldType, field_type >::value, derived_type >::type & | operator*= (const FieldType &kk) |
| vector space multiplication with scalar | |
| template<typename FieldType > | |
| std::enable_if< std::is_convertible< FieldType, field_type >::value, derived_type >::type & | operator/= (const FieldType &kk) |
| vector space division by scalar | |
| template<class Other > | |
| bool | operator== (const DenseVector< Other > &x) const |
| Binary vector comparison. | |
| template<class Other > | |
| bool | operator!= (const DenseVector< Other > &x) const |
| Binary vector incomparison. | |
| template<class Other > | |
| derived_type & | axpy (const field_type &a, const DenseVector< Other > &x) |
| vector space axpy operation ( *this += a x ) | |
| template<class Other > | |
| 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 | |
| template<class Other > | |
| 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 | |
| FieldTraits< value_type >::real_type | one_norm () const |
| one norm (sum over absolute values of entries) | |
| FieldTraits< value_type >::real_type | one_norm_real () const |
| simplified one norm (uses Manhattan norm for complex values) | |
| FieldTraits< value_type >::real_type | two_norm () const |
| two norm sqrt(sum over squared values of entries) | |
| FieldTraits< value_type >::real_type | two_norm2 () const |
| square of two norm (sum over squared values of entries), need for block recursion | |
| template<typename vt = value_type, typename std::enable_if<!HasNaN< vt >::value, int >::type = 0> | |
| FieldTraits< vt >::real_type | infinity_norm () const |
| infinity norm (maximum of absolute values of entries) | |
| template<typename vt = value_type, typename std::enable_if< HasNaN< vt >::value, int >::type = 0> | |
| FieldTraits< vt >::real_type | infinity_norm () const |
| infinity norm (maximum of absolute values of entries) | |
| template<typename vt = value_type, typename std::enable_if<!HasNaN< vt >::value, int >::type = 0> | |
| FieldTraits< vt >::real_type | infinity_norm_real () const |
| simplified infinity norm (uses Manhattan norm for complex values) | |
| template<typename vt = value_type, typename std::enable_if< HasNaN< vt >::value, int >::type = 0> | |
| FieldTraits< vt >::real_type | infinity_norm_real () const |
| simplified infinity norm (uses Manhattan norm for complex values) | |
| size_type | N () const |
| number of blocks in the vector (are of size 1 here) | |
| size_type | dim () const |
| dimension of the vector space | |
Static Public Attributes | |
| static constexpr int | blocklevel = 1 |
| The number of block levels we contain. This is the leaf, that is, 1. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<class K , class Allocator > | |
| std::istream & | operator>> (std::istream &in, DynamicVector< K, Allocator > &v) |
| Read a DynamicVector from an input stream. | |
| template<typename V > | |
| std::ostream & | operator<< (std::ostream &s, const DenseVector< V > &v) |
| Write a DenseVector to an output stream. | |
Detailed Description
class Dune::DynamicVector< K, Allocator >
Construct a vector with a dynamic size.
- Template Parameters
-
K is the field type (use float, double, complex, etc) Allocator type of allocator object used to define the storage allocation model, default Allocator = std::allocator< K >.
Member Typedef Documentation
◆ allocator_type
| typedef Allocator Dune::DynamicVector< K, Allocator >::allocator_type |
◆ block_type
|
inherited |
export the type representing the components
◆ const_iterator
|
inherited |
typedef for stl compliant access
◆ ConstIterator
|
inherited |
ConstIterator class for sequential access.
◆ container_type
| typedef std::vector< K, Allocator > Dune::DynamicVector< K, Allocator >::container_type |
◆ derived_type
|
inherited |
type of derived vector class
◆ field_type
|
inherited |
export the type representing the field
◆ Iterator
|
inherited |
Iterator class for sequential access.
◆ iterator
|
inherited |
typedef for stl compliant access
◆ size_type
| typedef Base::size_type Dune::DynamicVector< K, Allocator >::size_type |
◆ value_type
| typedef Base::value_type Dune::DynamicVector< K, Allocator >::value_type |
Constructor & Destructor Documentation
◆ DynamicVector() [1/8]
|
inlineexplicit |
Constructor making uninitialized vector.
◆ DynamicVector() [2/8]
|
inlineexplicit |
◆ DynamicVector() [3/8]
|
inline |
Constructor making vector with identical coordinates.
◆ DynamicVector() [4/8]
|
inline |
Construct from a std::initializer_list.
◆ DynamicVector() [5/8]
|
inline |
Constructor making vector with identical coordinates.
◆ DynamicVector() [6/8]
|
inline |
Move constructor.
◆ DynamicVector() [7/8]
|
inline |
◆ DynamicVector() [8/8]
|
inline |
Copy constructor from another DenseVector.
Member Function Documentation
◆ axpy()
|
inlineinherited |
vector space axpy operation ( *this += a x )
◆ back() [1/2]
|
inlineinherited |
return reference to last element
◆ back() [2/2]
|
inlineinherited |
return reference to last element
◆ beforeBegin() [1/2]
|
inlineinherited |
- Returns
- an iterator that is positioned before the first entry of the vector.
◆ beforeBegin() [2/2]
|
inlineinherited |
- Returns
- an iterator that is positioned before the first entry of the vector.
◆ beforeEnd() [1/2]
|
inlineinherited |
- Returns
- an iterator that is positioned before the end iterator of the vector, i.e. at the last entry.
◆ beforeEnd() [2/2]
|
inlineinherited |
- Returns
- an iterator that is positioned before the end iterator of the vector. i.e. at the last element
◆ begin() [1/2]
|
inlineinherited |
begin iterator
◆ begin() [2/2]
|
inlineinherited |
begin ConstIterator
◆ capacity()
|
inline |
Number of elements for which memory has been allocated.
capacity() is always greater than or equal to size().
◆ container() [1/2]
|
inline |
◆ container() [2/2]
|
inline |
◆ data() [1/2]
|
inlinenoexcept |
return pointer to underlying array
◆ data() [2/2]
|
inlinenoexcept |
return pointer to underlying array
◆ dim()
|
inlineinherited |
dimension of the vector space
◆ dot()
|
inlineinherited |
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
◆ empty()
|
inlineinherited |
checks whether the container is empty
◆ end() [1/2]
|
inlineinherited |
end iterator
◆ end() [2/2]
|
inlineinherited |
end ConstIterator
◆ find() [1/2]
|
inlineinherited |
return iterator to given element or end()
◆ find() [2/2]
|
inlineinherited |
return iterator to given element or end()
◆ front() [1/2]
|
inlineinherited |
return reference to first element
◆ front() [2/2]
|
inlineinherited |
return reference to first element
◆ infinity_norm() [1/2]
|
inlineinherited |
infinity norm (maximum of absolute values of entries)
◆ infinity_norm() [2/2]
|
inlineinherited |
infinity norm (maximum of absolute values of entries)
◆ infinity_norm_real() [1/2]
|
inlineinherited |
simplified infinity norm (uses Manhattan norm for complex values)
◆ infinity_norm_real() [2/2]
|
inlineinherited |
simplified infinity norm (uses Manhattan norm for complex values)
◆ N()
|
inlineinherited |
number of blocks in the vector (are of size 1 here)
◆ one_norm()
|
inlineinherited |
one norm (sum over absolute values of entries)
◆ one_norm_real()
|
inlineinherited |
simplified one norm (uses Manhattan norm for complex values)
◆ operator!=()
|
inlineinherited |
Binary vector incomparison.
◆ operator*()
|
inlineinherited |
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*=()
|
inlineinherited |
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+()
|
inlineinherited |
Binary vector addition.
◆ operator+=() [1/2]
|
inlineinherited |
vector space addition
◆ operator+=() [2/2]
|
inlineinherited |
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-() [1/2]
|
inlineinherited |
Vector negation.
◆ operator-() [2/2]
|
inlineinherited |
Binary vector subtraction.
◆ operator-=() [1/2]
|
inlineinherited |
vector space subtraction
◆ operator-=() [2/2]
|
inlineinherited |
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/=()
|
inlineinherited |
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/5]
|
default |
Assignment operator for other DenseVector of same type.
◆ operator=() [2/5]
|
inline |
Assignment operator for other DenseVector of different type.
◆ operator=() [3/5]
|
inline |
Copy assignment operator.
◆ operator=() [4/5]
|
inline |
Assignment operator for scalar.
◆ operator=() [5/5]
|
inline |
Move assignment operator.
◆ operator==()
|
inlineinherited |
Binary vector comparison.
◆ operator[]() [1/2]
|
inline |
◆ operator[]() [2/2]
|
inline |
◆ reserve()
|
inline |
◆ resize()
|
inline |
◆ size()
|
inline |
◆ two_norm()
|
inlineinherited |
two norm sqrt(sum over squared values of entries)
◆ two_norm2()
|
inlineinherited |
square of two norm (sum over squared values of entries), need for block recursion
Member Data Documentation
◆ blocklevel
|
staticconstexprinherited |
The number of block levels we contain. This is the leaf, that is, 1.
The documentation for this class was generated from the following file:
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8