dune-common  2.5-git
Public Types | Public Member Functions | Protected Member Functions | Related Functions | List of all members
Dune::DenseVector< V > Class Template Reference

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

#include <dune/common/densevector.hh>

Inheritance diagram for Dune::DenseVector< V >:
Inheritance graph

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 More...
 
typedef Traits::value_type value_type
 export the type representing the field More...
 
typedef Traits::value_type field_type
 export the type representing the field More...
 
typedef Traits::value_type block_type
 export the type representing the components More...
 
typedef Traits::size_type size_type
 The type used for the index access and size operation. More...
 
typedef DenseIterator< DenseVector, value_typeIterator
 Iterator class for sequential access. More...
 
typedef Iterator iterator
 typedef for stl compliant access More...
 
typedef DenseIterator< const DenseVector, const value_typeConstIterator
 ConstIterator class for sequential access. More...
 
typedef ConstIterator const_iterator
 typedef for stl compliant access More...
 

Public Member Functions

derived_typeoperator= (const value_type &k)
 Assignment operator for scalar. More...
 
value_typeoperator[] (size_type i)
 random access More...
 
const value_typeoperator[] (size_type i) const
 
size_type size () const
 size method More...
 
Iterator begin ()
 begin iterator More...
 
Iterator end ()
 end iterator More...
 
Iterator beforeEnd ()
 
Iterator beforeBegin ()
 
Iterator find (size_type i)
 return iterator to given element or end() More...
 
ConstIterator begin () const
 begin ConstIterator More...
 
ConstIterator end () const
 end ConstIterator More...
 
ConstIterator beforeEnd () const
 
ConstIterator beforeBegin () const
 
ConstIterator find (size_type i) const
 return iterator to given element or end() More...
 
template<class Other >
derived_typeoperator+= (const DenseVector< Other > &y)
 vector space addition More...
 
template<class Other >
derived_typeoperator-= (const DenseVector< Other > &y)
 vector space subtraction More...
 
template<class Other >
derived_type operator+ (const DenseVector< Other > &b) const
 Binary vector addition. More...
 
template<class Other >
derived_type operator- (const DenseVector< Other > &b) const
 Binary vector subtraction. More...
 
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. More...
 
template<class Other >
bool operator!= (const DenseVector< Other > &y) const
 Binary vector incomparison. More...
 
template<class Other >
derived_typeaxpy (const value_type &a, const DenseVector< Other > &y)
 vector space axpy operation ( *this += a y ) More...
 
template<class Other >
PromotionTraits< field_type, typename DenseVector< 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, typename DenseVector< 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) More...
 
FieldTraits< value_type >::real_type one_norm_real () const
 simplified one norm (uses Manhattan norm for complex values) More...
 
FieldTraits< value_type >::real_type two_norm () const
 two norm sqrt(sum over squared values of entries) More...
 
FieldTraits< value_type >::real_type two_norm2 () const
 square of two norm (sum over squared values of entries), need for block recursion More...
 
template<typename vt = value_type, typename std::enable_if<!has_nan< vt >::value, int >::type = 0>
FieldTraits< vt >::real_type infinity_norm () const
 infinity norm (maximum of absolute values of entries) More...
 
template<typename vt = value_type, typename std::enable_if<!has_nan< vt >::value, int >::type = 0>
FieldTraits< vt >::real_type infinity_norm_real () const
 simplified infinity norm (uses Manhattan norm for complex values) More...
 
template<typename vt = value_type, typename std::enable_if< has_nan< vt >::value, int >::type = 0>
FieldTraits< vt >::real_type infinity_norm () const
 infinity norm (maximum of absolute values of entries) More...
 
template<typename vt = value_type, typename std::enable_if< has_nan< vt >::value, int >::type = 0>
FieldTraits< vt >::real_type infinity_norm_real () const
 simplified infinity norm (uses Manhattan norm for complex values) More...
 
size_type N () const
 number of blocks in the vector (are of size 1 here) More...
 
size_type dim () const
 dimension of the vector space More...
 

Protected Member Functions

constexpr DenseVector ()
 

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;

Member Typedef Documentation

§ block_type

template<typename V>
typedef Traits::value_type Dune::DenseVector< V >::block_type

export the type representing the components

§ const_iterator

template<typename V>
typedef ConstIterator Dune::DenseVector< V >::const_iterator

typedef for stl compliant access

§ ConstIterator

template<typename V>
typedef DenseIterator<const DenseVector,const value_type> Dune::DenseVector< V >::ConstIterator

ConstIterator class for sequential access.

§ derived_type

template<typename V>
typedef Traits::derived_type Dune::DenseVector< V >::derived_type

type of derived vector class

§ field_type

template<typename V>
typedef Traits::value_type Dune::DenseVector< V >::field_type

export the type representing the field

§ Iterator

template<typename V>
typedef DenseIterator<DenseVector,value_type> Dune::DenseVector< V >::Iterator

Iterator class for sequential access.

§ iterator

template<typename V>
typedef Iterator Dune::DenseVector< V >::iterator

typedef for stl compliant access

§ size_type

template<typename V>
typedef Traits::size_type Dune::DenseVector< V >::size_type

The type used for the index access and size operation.

§ value_type

template<typename V>
typedef Traits::value_type Dune::DenseVector< V >::value_type

export the type representing the field

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.

Constructor & Destructor Documentation

§ DenseVector()

template<typename V>
constexpr Dune::DenseVector< V >::DenseVector ( )
inlineprotected

Member Function Documentation

§ axpy()

template<typename V>
template<class Other >
derived_type& Dune::DenseVector< V >::axpy ( const value_type a,
const DenseVector< Other > &  y 
)
inline

vector space axpy operation ( *this += a y )

§ 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.

§ 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

§ begin() [1/2]

template<typename V>
Iterator Dune::DenseVector< V >::begin ( )
inline

begin iterator

§ begin() [2/2]

template<typename V>
ConstIterator Dune::DenseVector< V >::begin ( ) const
inline

begin ConstIterator

§ dim()

template<typename V>
size_type Dune::DenseVector< V >::dim ( ) const
inline

dimension of the vector space

§ dot()

template<typename V>
template<class Other >
PromotionTraits<field_type,typename DenseVector<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

§ end() [1/2]

template<typename V>
Iterator Dune::DenseVector< V >::end ( )
inline

end iterator

§ end() [2/2]

template<typename V>
ConstIterator Dune::DenseVector< V >::end ( ) const
inline

end ConstIterator

§ find() [1/2]

template<typename V>
Iterator Dune::DenseVector< V >::find ( size_type  i)
inline

return iterator to given element or end()

§ find() [2/2]

template<typename V>
ConstIterator Dune::DenseVector< V >::find ( size_type  i) const
inline

return iterator to given element or end()

§ infinity_norm() [1/2]

template<typename V>
template<typename vt = value_type, typename std::enable_if<!has_nan< vt >::value, int >::type = 0>
FieldTraits<vt>::real_type Dune::DenseVector< V >::infinity_norm ( ) const
inline

infinity norm (maximum of absolute values of entries)

§ infinity_norm() [2/2]

template<typename V>
template<typename vt = value_type, typename std::enable_if< has_nan< vt >::value, int >::type = 0>
FieldTraits<vt>::real_type Dune::DenseVector< V >::infinity_norm ( ) const
inline

infinity norm (maximum of absolute values of entries)

§ infinity_norm_real() [1/2]

template<typename V>
template<typename vt = value_type, typename std::enable_if<!has_nan< vt >::value, int >::type = 0>
FieldTraits<vt>::real_type Dune::DenseVector< V >::infinity_norm_real ( ) const
inline

simplified infinity norm (uses Manhattan norm for complex values)

§ infinity_norm_real() [2/2]

template<typename V>
template<typename vt = value_type, typename std::enable_if< has_nan< vt >::value, int >::type = 0>
FieldTraits<vt>::real_type Dune::DenseVector< V >::infinity_norm_real ( ) const
inline

simplified infinity norm (uses Manhattan norm for complex values)

§ N()

template<typename V>
size_type Dune::DenseVector< V >::N ( ) const
inline

number of blocks in the vector (are of size 1 here)

§ one_norm()

template<typename V>
FieldTraits<value_type>::real_type Dune::DenseVector< V >::one_norm ( ) const
inline

one norm (sum over absolute values of entries)

§ one_norm_real()

template<typename V>
FieldTraits<value_type>::real_type Dune::DenseVector< V >::one_norm_real ( ) const
inline

simplified one norm (uses Manhattan norm for complex values)

§ operator!=()

template<typename V>
template<class Other >
bool Dune::DenseVector< V >::operator!= ( const DenseVector< Other > &  y) const
inline

Binary vector incomparison.

§ operator*()

template<typename V>
template<class Other >
PromotionTraits<field_type,typename DenseVector<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

§ 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.

§ operator+()

template<typename V>
template<class Other >
derived_type Dune::DenseVector< V >::operator+ ( const DenseVector< Other > &  b) const
inline

Binary vector addition.

§ operator+=() [1/2]

template<typename V>
template<class Other >
derived_type& Dune::DenseVector< V >::operator+= ( const DenseVector< Other > &  y)
inline

vector space addition

§ operator+=() [2/2]

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.

§ operator-()

template<typename V>
template<class Other >
derived_type Dune::DenseVector< V >::operator- ( const DenseVector< Other > &  b) const
inline

Binary vector subtraction.

§ operator-=() [1/2]

template<typename V>
template<class Other >
derived_type& Dune::DenseVector< V >::operator-= ( const DenseVector< Other > &  y)
inline

vector space subtraction

§ operator-=() [2/2]

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.

§ 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.

§ operator=()

template<typename V>
derived_type& Dune::DenseVector< V >::operator= ( const value_type k)
inline

Assignment operator for scalar.

§ operator==()

template<typename V>
template<class Other >
bool Dune::DenseVector< V >::operator== ( const DenseVector< Other > &  y) const
inline

Binary vector comparison.

§ operator[]() [1/2]

template<typename V>
value_type& Dune::DenseVector< V >::operator[] ( size_type  i)
inline

random access

§ operator[]() [2/2]

template<typename V>
const value_type& Dune::DenseVector< V >::operator[] ( size_type  i) const
inline

§ size()

template<typename V>
size_type Dune::DenseVector< V >::size ( ) const
inline

size method

§ two_norm()

template<typename V>
FieldTraits<value_type>::real_type Dune::DenseVector< V >::two_norm ( ) const
inline

two norm sqrt(sum over squared values of entries)

§ two_norm2()

template<typename V>
FieldTraits<value_type>::real_type Dune::DenseVector< V >::two_norm2 ( ) const
inline

square of two norm (sum over squared values of entries), need for block recursion


The documentation for this class was generated from the following file: