dune-fem  2.4.1-rc
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Related Functions | List of all members
Dune::Fem::VectorInterface< VT > Class Template Reference

An abstract vector interface. More...

#include </local/tomalk/somewhere/tmp/dune-fem/dune/fem/storage/vector.hh>

Inheritance diagram for Dune::Fem::VectorInterface< VT >:
Inheritance graph

Public Types

typedef VT Traits
 
typedef ThisType VectorInterfaceType
 type of this interface More...
 
typedef Traits::VectorType VectorType
 type of the implementation (Barton-Nackman) More...
 
typedef Traits::FieldType FieldType
 field type for the vector More...
 
typedef FieldType value_type
 
typedef Traits::ConstIteratorType ConstIteratorType
 type of constant iterator More...
 
typedef Traits::IteratorType IteratorType
 type of iterator More...
 
typedef Traits::ArrayType ArrayType
 type of the implementation (Barton-Nackman) More...
 
typedef ThisType ArrayInterfaceType
 type of this interface More...
 
typedef Traits::ElementType ElementType
 type of the array elements More...
 
typedef ConstIteratorType const_iterator
 type of constant iterator More...
 
typedef IteratorType iterator
 type of (non-constant) iterator More...
 
typedef unsigned int size_type
 type of unsigned integral type of indexing More...
 

Public Member Functions

template<class T >
VectorTypeoperator= (const VectorInterface< T > &v)
 Assign another vector to this one. More...
 
VectorTypeoperator= (const ThisType &v)
 Assign another vector to this one. More...
 
VectorTypeoperator= (const FieldType s)
 Initialize all fields of this vector with a scalar. More...
 
const FieldTypeoperator[] (unsigned int index) const
 Returns a const reference to the field indexed by index. More...
 
FieldTypeoperator[] (unsigned int index)
 Returns a reference to the field indexed by index. More...
 
template<class T >
VectorTypeoperator+= (const VectorInterface< T > &v)
 Add another vector to this one. More...
 
template<class T >
VectorTypeoperator-= (const VectorInterface< T > &v)
 Subtract another vector from this one. More...
 
VectorTypeoperator*= (const FieldType s)
 Multiply this vector by a scalar. More...
 
template<class T >
VectorTypeaddScaled (const FieldType s, const VectorInterface< T > &v)
 Add a multiple of another vector to this one. More...
 
template<class T >
void assign (const VectorInterface< T > &v)
 copy another vector to this one More...
 
void assign (const FieldType s)
 Initialize all fields of this vector with a scalar. More...
 
void clear ()
 initialize the vector to 0 More...
 
ConstIteratorType begin () const
 obtain begin iterator More...
 
IteratorType begin ()
 obtain begin iterator More...
 
ConstIteratorType end () const
 obtain end iterator More...
 
IteratorType end ()
 obtain end iterator More...
 
unsigned int size () const
 Returns the vector's size. More...
 
template<class T >
Traits::VectorType & operator= (const VectorInterface< T > &v)
 
template<class T >
Traits::VectorType & operator+= (const VectorInterface< T > &v)
 
template<class T >
Traits::VectorType & operator-= (const VectorInterface< T > &v)
 
template<class T >
Traits::VectorType & addScaled (const FieldType s, const VectorInterface< T > &v)
 
void assign (const ElementType &element)
 fill the array with copies of an element More...
 
void assign (const ArrayInterface< T > &other)
 copy another array to this one More...
 

Protected Member Functions

const VectorInterfaceArrayTraits< VT >::ArrayTypeasImp () const
 
VectorInterfaceArrayTraits< VT >::ArrayTypeasImp ()
 

Static Protected Member Functions

static const VectorInterfaceArrayTraits< VT >::ArrayTypeasImp (const ThisType &other)
 
static VectorInterfaceArrayTraits< VT >::ArrayTypeasImp (ThisType &other)
 

Related Functions

(Note that these are not member functions.)

template<class Traits >
std::ostream & operator<< (std::ostream &out, const VectorInterface< Traits > &v)
 write a vector into an STL stream More...
 
template<class Traits >
std::istream & operator>> (std::istream &in, VectorInterface< Traits > &v)
 read a vector from an STL stream More...
 

Detailed Description

template<class VT>
class Dune::Fem::VectorInterface< VT >

An abstract vector interface.

Member Typedef Documentation

type of this interface

typedef Traits::ArrayType Dune::Fem::ArrayInterface< VectorInterfaceArrayTraits< VT > >::ArrayType
inherited

type of the implementation (Barton-Nackman)

type of constant iterator

template<class VT>
typedef Traits::ConstIteratorType Dune::Fem::VectorInterface< VT >::ConstIteratorType

type of constant iterator

typedef Traits::ElementType Dune::Fem::ArrayInterface< VectorInterfaceArrayTraits< VT > >::ElementType
inherited

type of the array elements

template<class VT>
typedef Traits::FieldType Dune::Fem::VectorInterface< VT >::FieldType

field type for the vector

type of (non-constant) iterator

template<class VT>
typedef Traits::IteratorType Dune::Fem::VectorInterface< VT >::IteratorType

type of iterator

typedef unsigned int Dune::Fem::ArrayInterface< VectorInterfaceArrayTraits< VT > >::size_type
inherited

type of unsigned integral type of indexing

template<class VT>
typedef VT Dune::Fem::VectorInterface< VT >::Traits
template<class VT>
typedef FieldType Dune::Fem::VectorInterface< VT >::value_type
template<class VT>
typedef ThisType Dune::Fem::VectorInterface< VT >::VectorInterfaceType

type of this interface

template<class VT>
typedef Traits::VectorType Dune::Fem::VectorInterface< VT >::VectorType

type of the implementation (Barton-Nackman)

Member Function Documentation

template<class VT>
template<class T >
Traits :: VectorType& Dune::Fem::VectorInterface< VT >::addScaled ( const FieldType  s,
const VectorInterface< T > &  v 
)
inline
template<class VT>
template<class T >
VectorType& Dune::Fem::VectorInterface< VT >::addScaled ( const FieldType  s,
const VectorInterface< T > &  v 
)

Add a multiple of another vector to this one.

static const VectorInterfaceArrayTraits< VT >::ArrayType & Dune::Fem::BartonNackmanInterface< ArrayInterface< VectorInterfaceArrayTraits< VT > > , VectorInterfaceArrayTraits< VT >::ArrayType >::asImp ( const ThisType other)
inlinestaticprotectedinherited
void Dune::Fem::ArrayInterface< VectorInterfaceArrayTraits< VT > >::assign ( const ElementType element)
inlineinherited

fill the array with copies of an element

Parameters
[in]elementelement wich shall be copied into every array entry
template<class Traits >
template<class T >
void Dune::Fem::VectorInterface< Traits >::assign ( const VectorInterface< T > &  v)
inline

copy another vector to this one

Copies the data from another vector to this one. Both vectors must be of the same size.

Parameters
[in]vvector to copy

References Dune::Fem::BartonNackmanInterface< ArrayInterface< VectorInterfaceArrayTraits< VT > >, VectorInterfaceArrayTraits< VT >::ArrayType >::asImp().

Referenced by Dune::Fem::VectorInterface< VT >::operator>>().

void Dune::Fem::ArrayInterface< VectorInterfaceArrayTraits< VT > >::assign ( const ArrayInterface< T > &  other)
inlineinherited

copy another array to this one

Copies the data from another array to this one. Both arrays must be of the same size.

Parameters
[in]otherarray to copy
template<class Traits >
void Dune::Fem::VectorInterface< Traits >::assign ( const FieldType  s)
inline

Initialize all fields of this vector with a scalar.

template<class Traits >
Traits::ConstIteratorType Dune::Fem::VectorInterface< Traits >::begin ( ) const
inline

obtain begin iterator

Referenced by Dune::Fem::operator>>().

template<class Traits >
Traits::IteratorType Dune::Fem::VectorInterface< Traits >::begin ( )
inline

obtain begin iterator

template<class Traits >
void Dune::Fem::VectorInterface< Traits >::clear ( )
inline

initialize the vector to 0

template<class Traits >
Traits::ConstIteratorType Dune::Fem::VectorInterface< Traits >::end ( ) const
inline

obtain end iterator

Referenced by Dune::Fem::operator<<(), and Dune::Fem::operator>>().

template<class Traits >
Traits::IteratorType Dune::Fem::VectorInterface< Traits >::end ( )
inline

obtain end iterator

template<class Traits >
Traits::VectorType & Dune::Fem::VectorInterface< Traits >::operator*= ( const FieldType  s)
inline

Multiply this vector by a scalar.

template<class VT>
template<class T >
Traits :: VectorType& Dune::Fem::VectorInterface< VT >::operator+= ( const VectorInterface< T > &  v)
inline
template<class VT>
template<class T >
VectorType& Dune::Fem::VectorInterface< VT >::operator+= ( const VectorInterface< T > &  v)

Add another vector to this one.

template<class VT>
template<class T >
Traits :: VectorType& Dune::Fem::VectorInterface< VT >::operator-= ( const VectorInterface< T > &  v)
inline
template<class VT>
template<class T >
VectorType& Dune::Fem::VectorInterface< VT >::operator-= ( const VectorInterface< T > &  v)

Subtract another vector from this one.

template<class VT>
template<class T >
Traits :: VectorType& Dune::Fem::VectorInterface< VT >::operator= ( const VectorInterface< T > &  v)
inline
template<class VT>
template<class T >
VectorType& Dune::Fem::VectorInterface< VT >::operator= ( const VectorInterface< T > &  v)

Assign another vector to this one.

template<class Traits >
Traits::VectorType & Dune::Fem::VectorInterface< Traits >::operator= ( const ThisType v)
inline

Assign another vector to this one.

template<class Traits >
Traits::VectorType & Dune::Fem::VectorInterface< Traits >::operator= ( const FieldType  s)
inline

Initialize all fields of this vector with a scalar.

template<class Traits >
const Traits::FieldType & Dune::Fem::VectorInterface< Traits >::operator[] ( unsigned int  index) const
inline

Returns a const reference to the field indexed by index.

template<class Traits >
Traits::FieldType & Dune::Fem::VectorInterface< Traits >::operator[] ( unsigned int  index)
inline

Returns a reference to the field indexed by index.

template<class Traits >
unsigned int Dune::Fem::VectorInterface< Traits >::size ( ) const
inline

Friends And Related Function Documentation

template<class Traits >
std::ostream & operator<< ( std::ostream &  out,
const VectorInterface< Traits > &  v 
)
related

write a vector into an STL stream

Parameters
[in]outSTL stream to write to
[in]vvector to write
Returns
the STL stream (for concatenation)

References Dune::Fem::VectorInterface< VT >::size().

template<class Traits >
std::istream & operator>> ( std::istream &  in,
VectorInterface< Traits > &  v 
)
related

read a vector from an STL stream

Parameters
[in]inSTL stream to read from
[out]vvector to read
Note
This method is STL compilant, i.e. the vector is only assigned after the read operation is successful. This means that a temporary vector is created.
Returns
the STL stream (for concatenation)

References Dune::Fem::VectorInterface< VT >::assign(), Dune::Fem::match(), and Dune::Fem::VectorInterface< VT >::size().


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