Dune Core Modules (2.4.1)

vector space out of a tensor product of fields. More...

#include <dune/common/fvector.hh>

Public Types

enum  { dimension = SIZE }
 export size More...
 
enum  
 We are at the leaf of the block recursion.
 
typedef Traits::derived_type derived_type
 type of derived vector class
 
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 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

 FieldVector ()
 Constructor making default-initialized vector.
 
 FieldVector (const K &t)
 Constructor making vector with identical coordinates.
 
 FieldVector (const FieldVector &x)
 Constructor making vector with identical coordinates.
 
template<class C >
 FieldVector (const DenseVector< C > &x, typename Dune::enable_if< IsFieldVectorSizeCorrect< C, SIZE >::value >::type *dummy=0)
 Copy constructor from a second vector of possibly different type. More...
 
template<class K1 , int SIZE1>
 FieldVector (const FieldVector< K1, SIZE1 > &x)
 Constructor making vector with identical coordinates.
 
value_type & operator[] (size_type i)
 random access
 
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_typeoperator+= (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 More...
 
derived_typeoperator-= (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 More...
 
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< ValueType, value_type >::value, derived_type >::type & operator*= (const ValueType &kk)
 vector space multiplication with scalar More...
 
std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & operator/= (const ValueType &kk)
 vector space division by scalar More...
 
bool operator== (const DenseVector< Other > &y) const
 Binary vector comparison.
 
bool operator!= (const DenseVector< Other > &y) const
 Binary vector incomparison.
 
derived_typeaxpy (const value_type &a, const DenseVector< Other > &y)
 vector space axpy operation ( *this += a y )
 
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...
 
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<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

template<class K, int SIZE>
class Dune::FieldVector< K, SIZE >

vector space out of a tensor product of fields.

Template Parameters
Kthe field type (use float, double, complex, etc)
SIZEnumber of components.

Member Enumeration Documentation

◆ anonymous enum

template<class K , int SIZE>
anonymous enum

export size

Enumerator
dimension 

The size of this vector.

Constructor & Destructor Documentation

◆ FieldVector()

template<class K , int SIZE>
template<class C >
Dune::FieldVector< K, SIZE >::FieldVector ( const DenseVector< C > &  x,
typename Dune::enable_if< IsFieldVectorSizeCorrect< C, SIZE >::value >::type *  dummy = 0 
)
inline

Copy constructor from a second vector of possibly different type.

If the DenseVector type of the this constructor's argument is implemented by a FieldVector, it is statically checked if it has the correct size. If this is not the case the constructor is removed from the overload set using SFINAE.

Parameters
[in]xA DenseVector with correct size.
[in]dummyA void* dummy argument needed by SFINAE.

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

Member Function Documentation

◆ beforeBegin() [1/2]

Iterator Dune::DenseVector< FieldVector< K, SIZE > >::beforeBegin ( )
inlineinherited
Returns
an iterator that is positioned before the first entry of the vector.

◆ beforeBegin() [2/2]

ConstIterator Dune::DenseVector< FieldVector< K, SIZE > >::beforeBegin ( ) const
inlineinherited
Returns
an iterator that is positioned before the first entry of the vector.

◆ beforeEnd() [1/2]

Iterator Dune::DenseVector< FieldVector< K, SIZE > >::beforeEnd ( )
inlineinherited
Returns
an iterator that is positioned before the end iterator of the vector, i.e. at the last entry.

◆ beforeEnd() [2/2]

ConstIterator Dune::DenseVector< FieldVector< K, SIZE > >::beforeEnd ( ) const
inlineinherited
Returns
an iterator that is positioned before the end iterator of the vector. i.e. at the last element

◆ dot()

PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType Dune::DenseVector< FieldVector< K, SIZE > >::dot ( const DenseVector< Other > &  y) const
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
yother vector
Returns

◆ operator*()

PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType Dune::DenseVector< FieldVector< K, SIZE > >::operator* ( const DenseVector< Other > &  y) const
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
yother vector
Returns

◆ operator*=()

std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & Dune::DenseVector< FieldVector< K, SIZE > >::operator*= ( const ValueType &  kk)
inlineinherited

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+=()

std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & Dune::DenseVector< FieldVector< K, SIZE > >::operator+= ( const ValueType &  kk)
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-=()

std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & Dune::DenseVector< FieldVector< K, SIZE > >::operator-= ( const ValueType &  kk)
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/=()

std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & Dune::DenseVector< FieldVector< K, SIZE > >::operator/= ( const ValueType &  kk)
inlineinherited

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.

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  s,
const DenseVector< FieldVector< K, SIZE > > &  v 
)
related

Write a DenseVector to an output stream.

Parameters
[in]sstd :: ostream to write to
[in]vDenseVector to write
Returns
the output stream (s)

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