dune-common  2.3.1-rc1
Public Types | Public Member Functions | Related Functions | List of all members
Dune::FieldVector< K, N > Class Template Reference

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

#include <dune/common/densematrix.hh>

Inheritance diagram for Dune::FieldVector< K, N >:
Inheritance graph

Public Types

enum  { dimension = SIZE }
 export size More...
 
typedef Base::size_type size_type
 
typedef Base::value_type value_type
 
enum  
 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 field_type
 export the type representing the field More...
 
typedef Traits::value_type block_type
 export the type representing the components More...
 
typedef DenseIterator
< DenseVector, value_type
Iterator
 Iterator class for sequential access. More...
 
typedef Iterator iterator
 typedef for stl compliant access More...
 
typedef DenseIterator< const
DenseVector, const value_type
ConstIterator
 ConstIterator class for sequential access. More...
 
typedef ConstIterator const_iterator
 typedef for stl compliant access More...
 

Public Member Functions

 FieldVector ()
 Constructor making default-initialized vector. More...
 
 FieldVector (const K &t)
 Constructor making vector with identical coordinates. More...
 
 FieldVector (const FieldVector &x)
 Constructor making vector with identical coordinates. More...
 
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. More...
 
DUNE_CONSTEXPR size_type size () const
 
DUNE_CONSTEXPR size_type vec_size () const
 
K & vec_access (size_type i)
 
const K & vec_access (size_type i) const
 
value_typeoperator[] (size_type i)
 random access More...
 
const value_typeoperator[] (size_type i) const
 
Iterator begin ()
 begin iterator More...
 
ConstIterator begin () const
 begin ConstIterator More...
 
Iterator end ()
 end iterator More...
 
ConstIterator end () const
 end ConstIterator More...
 
Iterator beforeEnd ()
 
ConstIterator beforeEnd () const
 
Iterator beforeBegin ()
 
ConstIterator beforeBegin () const
 
Iterator find (size_type i)
 return iterator to given element or end() More...
 
ConstIterator find (size_type i) const
 return iterator to given element or end() More...
 
derived_typeoperator+= (const DenseVector< Other > &y)
 vector space addition More...
 
derived_typeoperator+= (const value_type &k)
 vector space add scalar to all comps More...
 
derived_typeoperator-= (const DenseVector< Other > &y)
 vector space subtraction More...
 
derived_typeoperator-= (const value_type &k)
 vector space subtract scalar from all comps More...
 
derived_type operator+ (const DenseVector< Other > &b) const
 Binary vector addition. More...
 
derived_type operator- (const DenseVector< Other > &b) const
 Binary vector subtraction. More...
 
derived_typeoperator*= (const value_type &k)
 vector space multiplication with scalar More...
 
derived_typeoperator/= (const value_type &k)
 vector space division by scalar More...
 
bool operator== (const DenseVector< Other > &y) const
 Binary vector comparison. More...
 
bool operator!= (const DenseVector< Other > &y) const
 Binary vector incomparison. More...
 
derived_typeaxpy (const value_type &a, const DenseVector< Other > &y)
 vector space axpy operation ( *this += a y ) More...
 
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...
 
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...
 
FieldTraits< value_type >
::real_type 
infinity_norm () const
 infinity norm (maximum of absolute values of entries) More...
 
FieldTraits< value_type >
::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...
 

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

Detailed Description

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

vector space out of a tensor product of fields.

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

Member Typedef Documentation

typedef Traits::value_type Dune::DenseVector< FieldVector< K, SIZE > >::block_type
inherited

export the type representing the components

typedef ConstIterator Dune::DenseVector< FieldVector< K, SIZE > >::const_iterator
inherited

typedef for stl compliant access

typedef DenseIterator<const DenseVector,const value_type> Dune::DenseVector< FieldVector< K, SIZE > >::ConstIterator
inherited

ConstIterator class for sequential access.

type of derived vector class

typedef Traits::value_type Dune::DenseVector< FieldVector< K, SIZE > >::field_type
inherited

export the type representing the field

Iterator class for sequential access.

typedef Iterator Dune::DenseVector< FieldVector< K, SIZE > >::iterator
inherited

typedef for stl compliant access

template<class K, int N>
typedef Base::size_type Dune::FieldVector< K, N >::size_type
template<class K, int N>
typedef Base::value_type Dune::FieldVector< K, N >::value_type

Member Enumeration Documentation

anonymous enum
inherited

We are at the leaf of the block recursion.

template<class K, int N>
anonymous enum

export size

Enumerator
dimension 

The size of this vector.

Constructor & Destructor Documentation

template<class K, int N>
Dune::FieldVector< K, N >::FieldVector ( )
inline

Constructor making default-initialized vector.

template<class K, int N>
Dune::FieldVector< K, N >::FieldVector ( const K &  t)
inlineexplicit

Constructor making vector with identical coordinates.

template<class K, int N>
Dune::FieldVector< K, N >::FieldVector ( const FieldVector< K, N > &  x)
inline

Constructor making vector with identical coordinates.

template<class K, int N>
template<class C >
Dune::FieldVector< K, N >::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.
template<class K, int N>
template<class K1 , int SIZE1>
Dune::FieldVector< K, N >::FieldVector ( const FieldVector< K1, SIZE1 > &  x)
inlineexplicit

Constructor making vector with identical coordinates.

Member Function Documentation

derived_type& Dune::DenseVector< FieldVector< K, SIZE > >::axpy ( const value_type a,
const DenseVector< Other > &  y 
)
inlineinherited

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

Iterator Dune::DenseVector< FieldVector< K, SIZE > >::beforeBegin ( )
inlineinherited
Returns
an iterator that is positioned before the first entry of the vector.
ConstIterator Dune::DenseVector< FieldVector< K, SIZE > >::beforeBegin ( ) const
inlineinherited
Returns
an iterator that is positioned before the first entry of the vector.
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.
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
Iterator Dune::DenseVector< FieldVector< K, SIZE > >::begin ( )
inlineinherited
ConstIterator Dune::DenseVector< FieldVector< K, SIZE > >::begin ( ) const
inlineinherited

begin ConstIterator

size_type Dune::DenseVector< FieldVector< K, SIZE > >::dim ( ) const
inlineinherited

dimension of the vector space

PromotionTraits<field_type,typename DenseVector<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
Iterator Dune::DenseVector< FieldVector< K, SIZE > >::end ( )
inlineinherited
ConstIterator Dune::DenseVector< FieldVector< K, SIZE > >::end ( ) const
inlineinherited

end ConstIterator

Iterator Dune::DenseVector< FieldVector< K, SIZE > >::find ( size_type  i)
inlineinherited

return iterator to given element or end()

ConstIterator Dune::DenseVector< FieldVector< K, SIZE > >::find ( size_type  i) const
inlineinherited

return iterator to given element or end()

FieldTraits<value_type>::real_type Dune::DenseVector< FieldVector< K, SIZE > >::infinity_norm ( ) const
inlineinherited

infinity norm (maximum of absolute values of entries)

FieldTraits<value_type>::real_type Dune::DenseVector< FieldVector< K, SIZE > >::infinity_norm_real ( ) const
inlineinherited

simplified infinity norm (uses Manhattan norm for complex values)

size_type Dune::DenseVector< FieldVector< K, SIZE > >::N ( ) const
inlineinherited

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

FieldTraits<value_type>::real_type Dune::DenseVector< FieldVector< K, SIZE > >::one_norm ( ) const
inlineinherited

one norm (sum over absolute values of entries)

FieldTraits<value_type>::real_type Dune::DenseVector< FieldVector< K, SIZE > >::one_norm_real ( ) const
inlineinherited

simplified one norm (uses Manhattan norm for complex values)

bool Dune::DenseVector< FieldVector< K, SIZE > >::operator!= ( const DenseVector< Other > &  y) const
inlineinherited

Binary vector incomparison.

PromotionTraits<field_type,typename DenseVector<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
derived_type& Dune::DenseVector< FieldVector< K, SIZE > >::operator*= ( const value_type k)
inlineinherited

vector space multiplication with scalar

derived_type Dune::DenseVector< FieldVector< K, SIZE > >::operator+ ( const DenseVector< Other > &  b) const
inlineinherited

Binary vector addition.

derived_type& Dune::DenseVector< FieldVector< K, SIZE > >::operator+= ( const DenseVector< Other > &  y)
inlineinherited

vector space addition

derived_type& Dune::DenseVector< FieldVector< K, SIZE > >::operator+= ( const value_type k)
inlineinherited

vector space add scalar to all comps

derived_type Dune::DenseVector< FieldVector< K, SIZE > >::operator- ( const DenseVector< Other > &  b) const
inlineinherited

Binary vector subtraction.

derived_type& Dune::DenseVector< FieldVector< K, SIZE > >::operator-= ( const DenseVector< Other > &  y)
inlineinherited

vector space subtraction

derived_type& Dune::DenseVector< FieldVector< K, SIZE > >::operator-= ( const value_type k)
inlineinherited

vector space subtract scalar from all comps

derived_type& Dune::DenseVector< FieldVector< K, SIZE > >::operator/= ( const value_type k)
inlineinherited

vector space division by scalar

bool Dune::DenseVector< FieldVector< K, SIZE > >::operator== ( const DenseVector< Other > &  y) const
inlineinherited

Binary vector comparison.

value_type& Dune::DenseVector< FieldVector< K, SIZE > >::operator[] ( size_type  i)
inlineinherited

random access

const value_type& Dune::DenseVector< FieldVector< K, SIZE > >::operator[] ( size_type  i) const
inlineinherited
template<class K, int N>
DUNE_CONSTEXPR size_type Dune::FieldVector< K, N >::size ( ) const
inline
FieldTraits<value_type>::real_type Dune::DenseVector< FieldVector< K, SIZE > >::two_norm ( ) const
inlineinherited

two norm sqrt(sum over squared values of entries)

FieldTraits<value_type>::real_type Dune::DenseVector< FieldVector< K, SIZE > >::two_norm2 ( ) const
inlineinherited

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

template<class K, int N>
K& Dune::FieldVector< K, N >::vec_access ( size_type  i)
inline
template<class K, int N>
const K& Dune::FieldVector< K, N >::vec_access ( size_type  i) const
inline
template<class K, int N>
DUNE_CONSTEXPR size_type Dune::FieldVector< K, N >::vec_size ( ) const
inline

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