Construct a vector with a dynamic size. More...
#include <dune/common/dynvector.hh>
Public Types | |
typedef Base::size_type | size_type |
The type used for the index access and size operation. | |
typedef Base::value_type | value_type |
export the type representing the field | |
typedef Allocator | allocator_type |
enum | |
We are at the leaf of the block recursion. More... | |
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 |
size method | |
K & | operator[] (size_type i) |
const K & | operator[] (size_type i) const |
value_type & | operator[] (size_type i) |
random access | |
const value_type & | operator[] (size_type i) const |
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() | |
derived_type & | operator+= (const DenseVector< Other > &y) |
vector space addition | |
std::enable_if < std::is_convertible < ValueType, value_type > ::value, derived_type >::type & | operator+= (const ValueType &kk) |
vector space add scalar to all comps | |
derived_type & | operator-= (const DenseVector< Other > &y) |
vector space subtraction | |
std::enable_if < std::is_convertible < ValueType, value_type > ::value, derived_type >::type & | operator-= (const ValueType &kk) |
vector space subtract scalar from all comps | |
derived_type | operator+ (const DenseVector< Other > &b) const |
Binary vector addition. | |
derived_type | operator- (const DenseVector< Other > &b) const |
Binary vector subtraction. | |
std::enable_if < std::is_convertible < FieldType, field_type > ::value, derived_type >::type & | operator*= (const FieldType &kk) |
vector space multiplication with scalar | |
std::enable_if < std::is_convertible < FieldType, field_type > ::value, derived_type >::type & | operator/= (const FieldType &kk) |
vector space division by scalar | |
bool | operator== (const DenseVector< Other > &y) const |
Binary vector comparison. | |
bool | operator!= (const DenseVector< Other > &y) const |
Binary vector incomparison. | |
derived_type & | axpy (const field_type &a, const DenseVector< Other > &y) |
vector space axpy operation ( *this += a y ) | |
PromotionTraits< field_type, typename DenseVector< Other > ::field_type >::PromotedType | operator* (const DenseVector< Other > &y) const |
indefinite vector dot product ![]() | |
PromotionTraits< field_type, typename DenseVector< Other > ::field_type >::PromotedType | dot (const DenseVector< Other > &y) const |
vector dot product ![]() | |
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 | |
FieldTraits< vt >::real_type | infinity_norm () const |
infinity norm (maximum of absolute values of entries) | |
FieldTraits< vt >::real_type | infinity_norm () const |
infinity norm (maximum of absolute values of entries) | |
FieldTraits< vt >::real_type | infinity_norm_real () const |
simplified infinity norm (uses Manhattan norm for complex values) | |
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 | |
Related Functions | |
(Note that these are not member functions.) | |
template<class K , class Allocator > | |
std::istream & | operator>> (std::istream &in, DynamicVector< K, Allocator > &v) |
Read a DynamicVector from an input stream. |
Construct a vector with a dynamic size.
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 >. |
typedef Allocator Dune::DynamicVector< K, Allocator >::allocator_type |
typedef Traits::value_type Dune::DenseVector< DynamicVector< K, Allocator > >::block_type [inherited] |
export the type representing the components
typedef ConstIterator Dune::DenseVector< DynamicVector< K, Allocator > >::const_iterator [inherited] |
typedef for stl compliant access
typedef DenseIterator<const DenseVector,const value_type> Dune::DenseVector< DynamicVector< K, Allocator > >::ConstIterator [inherited] |
ConstIterator class for sequential access.
typedef Traits::derived_type Dune::DenseVector< DynamicVector< K, Allocator > >::derived_type [inherited] |
type of derived vector class
typedef FieldTraits< value_type >::field_type Dune::DenseVector< DynamicVector< K, Allocator > >::field_type [inherited] |
export the type representing the field
typedef Iterator Dune::DenseVector< DynamicVector< K, Allocator > >::iterator [inherited] |
typedef for stl compliant access
typedef DenseIterator<DenseVector,value_type> Dune::DenseVector< DynamicVector< K, Allocator > >::Iterator [inherited] |
Iterator class for sequential access.
typedef Base::size_type Dune::DynamicVector< K, Allocator >::size_type |
The type used for the index access and size operation.
Reimplemented from Dune::DenseVector< DynamicVector< K, Allocator > >.
typedef Base::value_type Dune::DynamicVector< K, Allocator >::value_type |
export the type representing the field
Reimplemented from Dune::DenseVector< DynamicVector< K, Allocator > >.
anonymous enum [inherited] |
We are at the leaf of the block recursion.
Dune::DynamicVector< K, Allocator >::DynamicVector | ( | const allocator_type & | a = allocator_type() |
) | [inline, explicit] |
Constructor making uninitialized vector.
Dune::DynamicVector< K, Allocator >::DynamicVector | ( | size_type | n, | |
const allocator_type & | a = allocator_type() | |||
) | [inline, explicit] |
Dune::DynamicVector< K, Allocator >::DynamicVector | ( | size_type | n, | |
value_type | c, | |||
const allocator_type & | a = allocator_type() | |||
) | [inline] |
Constructor making vector with identical coordinates.
Dune::DynamicVector< K, Allocator >::DynamicVector | ( | std::initializer_list< K > const & | l | ) | [inline] |
Construct from a std::initializer_list.
Dune::DynamicVector< K, Allocator >::DynamicVector | ( | const DynamicVector< K, Allocator > & | x | ) | [inline] |
Constructor making vector with identical coordinates.
Dune::DynamicVector< K, Allocator >::DynamicVector | ( | DynamicVector< K, Allocator > && | x | ) | [inline] |
Move constructor.
Dune::DynamicVector< K, Allocator >::DynamicVector | ( | const DynamicVector< T, Allocator > & | x | ) | [inline] |
Dune::DynamicVector< K, Allocator >::DynamicVector | ( | const DenseVector< X > & | x, | |
const allocator_type & | a = allocator_type() | |||
) | [inline] |
Copy constructor from another DenseVector.
derived_type& Dune::DenseVector< DynamicVector< K, Allocator > >::axpy | ( | const field_type & | a, | |
const DenseVector< Other > & | y | |||
) | [inline, inherited] |
vector space axpy operation ( *this += a y )
ConstIterator Dune::DenseVector< DynamicVector< K, Allocator > >::beforeBegin | ( | ) | const [inline, inherited] |
Iterator Dune::DenseVector< DynamicVector< K, Allocator > >::beforeBegin | ( | ) | [inline, inherited] |
ConstIterator Dune::DenseVector< DynamicVector< K, Allocator > >::beforeEnd | ( | ) | const [inline, inherited] |
Iterator Dune::DenseVector< DynamicVector< K, Allocator > >::beforeEnd | ( | ) | [inline, inherited] |
ConstIterator Dune::DenseVector< DynamicVector< K, Allocator > >::begin | ( | ) | const [inline, inherited] |
begin ConstIterator
Iterator Dune::DenseVector< DynamicVector< K, Allocator > >::begin | ( | ) | [inline, inherited] |
begin iterator
size_type Dune::DynamicVector< K, Allocator >::capacity | ( | ) | const [inline] |
Number of elements for which memory has been allocated.
capacity() is always greater than or equal to size().
size_type Dune::DenseVector< DynamicVector< K, Allocator > >::dim | ( | ) | const [inline, inherited] |
dimension of the vector space
PromotionTraits<field_type,typename DenseVector<Other>::field_type>::PromotedType Dune::DenseVector< DynamicVector< K, Allocator > >::dot | ( | const DenseVector< Other > & | y | ) | const [inline, inherited] |
vector dot product which corresponds to Petsc's VecDot
http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecDot.html
y | other vector |
ConstIterator Dune::DenseVector< DynamicVector< K, Allocator > >::end | ( | ) | const [inline, inherited] |
end ConstIterator
Iterator Dune::DenseVector< DynamicVector< K, Allocator > >::end | ( | ) | [inline, inherited] |
end iterator
ConstIterator Dune::DenseVector< DynamicVector< K, Allocator > >::find | ( | size_type | i | ) | const [inline, inherited] |
return iterator to given element or end()
Iterator Dune::DenseVector< DynamicVector< K, Allocator > >::find | ( | size_type | i | ) | [inline, inherited] |
return iterator to given element or end()
FieldTraits<vt>::real_type Dune::DenseVector< DynamicVector< K, Allocator > >::infinity_norm | ( | ) | const [inline, inherited] |
infinity norm (maximum of absolute values of entries)
FieldTraits<vt>::real_type Dune::DenseVector< DynamicVector< K, Allocator > >::infinity_norm | ( | ) | const [inline, inherited] |
infinity norm (maximum of absolute values of entries)
FieldTraits<vt>::real_type Dune::DenseVector< DynamicVector< K, Allocator > >::infinity_norm_real | ( | ) | const [inline, inherited] |
simplified infinity norm (uses Manhattan norm for complex values)
FieldTraits<vt>::real_type Dune::DenseVector< DynamicVector< K, Allocator > >::infinity_norm_real | ( | ) | const [inline, inherited] |
simplified infinity norm (uses Manhattan norm for complex values)
size_type Dune::DenseVector< DynamicVector< K, Allocator > >::N | ( | ) | const [inline, inherited] |
number of blocks in the vector (are of size 1 here)
FieldTraits<value_type>::real_type Dune::DenseVector< DynamicVector< K, Allocator > >::one_norm | ( | ) | const [inline, inherited] |
one norm (sum over absolute values of entries)
FieldTraits<value_type>::real_type Dune::DenseVector< DynamicVector< K, Allocator > >::one_norm_real | ( | ) | const [inline, inherited] |
simplified one norm (uses Manhattan norm for complex values)
bool Dune::DenseVector< DynamicVector< K, Allocator > >::operator!= | ( | const DenseVector< Other > & | y | ) | const [inline, inherited] |
Binary vector incomparison.
PromotionTraits<field_type,typename DenseVector<Other>::field_type>::PromotedType Dune::DenseVector< DynamicVector< K, Allocator > >::operator* | ( | const DenseVector< Other > & | y | ) | const [inline, inherited] |
indefinite vector dot product which corresponds to Petsc's VecTDot
http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecTDot.html
y | other vector |
std::enable_if< std::is_convertible<FieldType, field_type>::value, derived_type >::type& Dune::DenseVector< DynamicVector< K, Allocator > >::operator*= | ( | const FieldType & | kk | ) | [inline, inherited] |
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.
derived_type Dune::DenseVector< DynamicVector< K, Allocator > >::operator+ | ( | const DenseVector< Other > & | b | ) | const [inline, inherited] |
Binary vector addition.
std::enable_if< std::is_convertible<ValueType, value_type>::value, derived_type >::type& Dune::DenseVector< DynamicVector< K, Allocator > >::operator+= | ( | const ValueType & | kk | ) | [inline, inherited] |
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.
derived_type& Dune::DenseVector< DynamicVector< K, Allocator > >::operator+= | ( | const DenseVector< Other > & | y | ) | [inline, inherited] |
vector space addition
derived_type Dune::DenseVector< DynamicVector< K, Allocator > >::operator- | ( | const DenseVector< Other > & | b | ) | const [inline, inherited] |
Binary vector subtraction.
std::enable_if< std::is_convertible<ValueType, value_type>::value, derived_type >::type& Dune::DenseVector< DynamicVector< K, Allocator > >::operator-= | ( | const ValueType & | kk | ) | [inline, inherited] |
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.
derived_type& Dune::DenseVector< DynamicVector< K, Allocator > >::operator-= | ( | const DenseVector< Other > & | y | ) | [inline, inherited] |
vector space subtraction
std::enable_if< std::is_convertible<FieldType, field_type>::value, derived_type >::type& Dune::DenseVector< DynamicVector< K, Allocator > >::operator/= | ( | const FieldType & | kk | ) | [inline, inherited] |
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.
DynamicVector& Dune::DynamicVector< K, Allocator >::operator= | ( | DynamicVector< K, Allocator > && | other | ) | [inline] |
Move assignment operator.
DynamicVector& Dune::DynamicVector< K, Allocator >::operator= | ( | const DynamicVector< K, Allocator > & | other | ) | [inline] |
Copy assignment operator.
bool Dune::DenseVector< DynamicVector< K, Allocator > >::operator== | ( | const DenseVector< Other > & | y | ) | const [inline, inherited] |
Binary vector comparison.
const value_type& Dune::DenseVector< DynamicVector< K, Allocator > >::operator[] | ( | size_type | i | ) | const [inline, inherited] |
value_type& Dune::DenseVector< DynamicVector< K, Allocator > >::operator[] | ( | size_type | i | ) | [inline, inherited] |
random access
const K& Dune::DynamicVector< K, Allocator >::operator[] | ( | size_type | i | ) | const [inline] |
K& Dune::DynamicVector< K, Allocator >::operator[] | ( | size_type | i | ) | [inline] |
void Dune::DynamicVector< K, Allocator >::reserve | ( | size_type | n | ) | [inline] |
void Dune::DynamicVector< K, Allocator >::resize | ( | size_type | n, | |
value_type | c = value_type() | |||
) | [inline] |
size_type Dune::DynamicVector< K, Allocator >::size | ( | ) | const [inline] |
size method
Reimplemented from Dune::DenseVector< DynamicVector< K, Allocator > >.
FieldTraits<value_type>::real_type Dune::DenseVector< DynamicVector< K, Allocator > >::two_norm | ( | ) | const [inline, inherited] |
two norm sqrt(sum over squared values of entries)
FieldTraits<value_type>::real_type Dune::DenseVector< DynamicVector< K, Allocator > >::two_norm2 | ( | ) | const [inline, inherited] |
square of two norm (sum over squared values of entries), need for block recursion