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

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

#include <dune/common/fvector.hh>

Inheritance diagram for Dune::FieldVector< K, SIZE >:
Dune::DenseVector< FieldVector< K, SIZE > >

Public Types

enum  { dimension = SIZE, size = 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
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 uninitialized 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.
template<class K1 , int SIZE1>
 FieldVector (const FieldVector< K1, SIZE1 > &x)
 Constructor making vector with identical coordinates.
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
const value_typeoperator[] (size_type i) const
size_type size () const
 size method
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
derived_typeoperator+= (const value_type &k)
 vector space add scalar to all comps
derived_typeoperator-= (const DenseVector< Other > &y)
 vector space subtraction
derived_typeoperator-= (const value_type &k)
 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.
derived_typeoperator*= (const value_type &k)
 vector space multiplication with scalar
derived_typeoperator/= (const value_type &k)
 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_typeaxpy (const value_type &a, const DenseVector< Other > &y)
 vector space axpy operation ( *this += a y )
value_type operator* (const DenseVector< Other > &y) const
 scalar product (x^T y)
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.

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 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 SIZE>
typedef Base::size_type Dune::FieldVector< K, SIZE >::size_type
template<class K, int SIZE>
typedef Base::value_type Dune::FieldVector< K, SIZE >::value_type

Member Enumeration Documentation

anonymous enum
inherited

We are at the leaf of the block recursion.

template<class K, int SIZE>
anonymous enum

export size

Enumerator:
dimension 

The size of this vector.

size 

The size of this vector.

Constructor & Destructor Documentation

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

Constructor making uninitialized vector.

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

Constructor making vector with identical coordinates.

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

Constructor making vector with identical coordinates.

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.
template<class K, int SIZE>
template<class K1 , int SIZE1>
Dune::FieldVector< K, SIZE >::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 )

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

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.

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

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

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

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

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

Iterator Dune::DenseVector< FieldVector< K, SIZE > >::end ( )
inlineinherited
ConstIterator Dune::DenseVector< FieldVector< K, SIZE > >::end ( ) const
inlineinherited

end ConstIterator

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

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

return iterator to given element or end()

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

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

return iterator to given element or end()

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

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

infinity norm (maximum of absolute values of entries)

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

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

simplified infinity norm (uses Manhattan norm for complex values)

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

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

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

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

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

one norm (sum over absolute values of entries)

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

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

simplified one norm (uses Manhattan norm for complex values)

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

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

Binary vector incomparison.

References Dune::DenseVector< V >::operator==().

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

scalar product (x^T y)

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

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

vector space multiplication with scalar

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

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

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

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

vector space add scalar to all comps

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

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

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

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

vector space subtract scalar from all comps

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

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

vector space division by scalar

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

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

Binary vector comparison.

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

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
size_type Dune::DenseVector< FieldVector< K, SIZE > >::size ( ) const
inlineinherited

size method

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

two norm sqrt(sum over squared values of entries)

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

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

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

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

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