Dune Core Modules (2.4.1)

Interface for a class of dense vectors over a given field. More...

#include <dune/common/densevector.hh>

Public Types

enum  { blocklevel = 1 }
 We are at the leaf of the block recursion. More...
 
typedef Traits::derived_type derived_type
 type of derived vector class
 
typedef Traits::value_type value_type
 export the type representing the field
 
typedef Traits::value_type field_type
 export the type representing the field
 
typedef Traits::value_type block_type
 export the type representing the components
 
typedef Traits::size_type size_type
 The type used for the index access and size operation.
 
typedef DenseIterator< DenseVector, value_typeIterator
 Iterator class for sequential access.
 
typedef Iterator iterator
 typedef for stl compliant access
 
typedef DenseIterator< const DenseVector, const value_typeConstIterator
 ConstIterator class for sequential access.
 
typedef ConstIterator const_iterator
 typedef for stl compliant access
 

Public Member Functions

derived_typeoperator= (const value_type &k)
 Assignment operator for scalar.
 
value_typeoperator[] (size_type i)
 random access
 
size_type size () const
 size method
 
Iterator begin ()
 begin iterator
 
Iterator end ()
 end iterator
 
Iterator beforeEnd ()
 
Iterator beforeBegin ()
 
Iterator find (size_type i)
 return iterator to given element or end()
 
ConstIterator begin () const
 begin ConstIterator
 
ConstIterator end () const
 end ConstIterator
 
ConstIterator beforeEnd () const
 
ConstIterator beforeBegin () const
 
ConstIterator find (size_type i) const
 return iterator to given element or end()
 
template<class Other >
derived_typeoperator+= (const DenseVector< Other > &y)
 vector space addition
 
template<class Other >
derived_typeoperator-= (const DenseVector< Other > &y)
 vector space subtraction
 
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.
 
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 More...
 
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 More...
 
template<typename ValueType >
std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & operator*= (const ValueType &kk)
 vector space multiplication with scalar More...
 
template<typename ValueType >
std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & operator/= (const ValueType &kk)
 vector space division by scalar More...
 
template<class Other >
bool operator== (const DenseVector< Other > &y) const
 Binary vector comparison.
 
template<class Other >
bool operator!= (const DenseVector< Other > &y) const
 Binary vector incomparison.
 
template<class Other >
derived_typeaxpy (const value_type &a, const DenseVector< Other > &y)
 vector space axpy operation ( *this += a y )
 
template<class Other >
PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType operator* (const DenseVector< Other > &y) const
 indefinite vector dot product \(\left (x^T \cdot y \right)\) which corresponds to Petsc's VecTDot More...
 
template<class Other >
PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType dot (const DenseVector< Other > &y) const
 vector dot product \(\left (x^H \cdot y \right)\) which corresponds to Petsc's VecDot More...
 
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< value_type >::real_type infinity_norm () const
 infinity norm (maximum of absolute values of entries)
 
FieldTraits< value_type >::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<typename V >
std::ostream & operator<< (std::ostream &s, const DenseVector< V > &v)
 Write a DenseVector to an output stream. More...
 

Detailed Description

template<typename V>
class Dune::DenseVector< V >

Interface for a class of dense vectors over a given field.

Template Parameters
Vimplementation class of the vector
Tvalue type
Ssize type

V has to provide the following members:

T & _access (size_type);
const T & _access (size_type) const;
size_type _size () const;
Traits::size_type size_type
The type used for the index access and size operation.
Definition: densevector.hh:265

Member Enumeration Documentation

◆ anonymous enum

template<typename V >
anonymous enum

We are at the leaf of the block recursion.

Enumerator
blocklevel 

The number of block levels we contain.

Member Function Documentation

◆ beforeBegin() [1/2]

template<typename V >
Iterator Dune::DenseVector< V >::beforeBegin ( )
inline
Returns
an iterator that is positioned before the first entry of the vector.

◆ beforeBegin() [2/2]

template<typename V >
ConstIterator Dune::DenseVector< V >::beforeBegin ( ) const
inline
Returns
an iterator that is positioned before the first entry of the vector.

◆ beforeEnd() [1/2]

template<typename V >
Iterator Dune::DenseVector< V >::beforeEnd ( )
inline
Returns
an iterator that is positioned before the end iterator of the vector, i.e. at the last entry.

References Dune::DenseVector< V >::size().

◆ beforeEnd() [2/2]

template<typename V >
ConstIterator Dune::DenseVector< V >::beforeEnd ( ) const
inline
Returns
an iterator that is positioned before the end iterator of the vector. i.e. at the last element

References Dune::DenseVector< V >::size().

◆ dot()

template<typename V >
template<class Other >
PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType Dune::DenseVector< V >::dot ( const DenseVector< Other > &  y) const
inline

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
yother vector
Returns

References Dune::dot(), and Dune::DenseVector< V >::size().

◆ operator*()

template<typename V >
template<class Other >
PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType Dune::DenseVector< V >::operator* ( const DenseVector< Other > &  y) const
inline

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
yother vector
Returns

References Dune::DenseVector< V >::size().

◆ operator*=()

template<typename V >
template<typename ValueType >
std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & Dune::DenseVector< V >::operator*= ( const ValueType &  kk)
inline

vector space multiplication with scalar

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.

References Dune::DenseVector< V >::size().

◆ operator+=()

template<typename V >
template<typename ValueType >
std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & Dune::DenseVector< V >::operator+= ( const ValueType &  kk)
inline

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.

References Dune::DenseVector< V >::size().

◆ operator-=()

template<typename V >
template<typename ValueType >
std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & Dune::DenseVector< V >::operator-= ( const ValueType &  kk)
inline

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.

References Dune::DenseVector< V >::size().

◆ operator/=()

template<typename V >
template<typename ValueType >
std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & Dune::DenseVector< V >::operator/= ( const ValueType &  kk)
inline

vector space division by scalar

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.

References Dune::DenseVector< V >::size().


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)