dune-fem  2.4.1-rc
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Dune::Fem::StaticArray< T > Class Template Reference

Static Array Wrapper for simple C Vectors like double* and int*. This also works as base class for the MutableArray which is used to store the degrees of freedom. More...

#include </local/tomalk/somewhere/tmp/dune-fem/dune/fem/space/common/arrays.hh>

Inheritance diagram for Dune::Fem::StaticArray< T >:
Inheritance graph

Public Types

typedef T FieldType
 
typedef T value_type
 definition conforming to STL More...
 
typedef T block_type
 definition conforming to ISTL More...
 
typedef GenericIterator< ThisType, T > DofIteratorType
 DofIterator. More...
 
typedef DofIteratorType iterator
 make compatible with std::vector More...
 
typedef GenericIterator< const ThisType, const T > ConstDofIteratorType
 Const DofIterator. More...
 
typedef ConstDofIteratorType const_iterator
 make compatible with std::vector More...
 
typedef size_t size_type
 type of unsigned integral type of indexing More...
 

Public Member Functions

 StaticArray (const size_t size, T *vec)
 create array of length size and store vec as pointer to memory More...
 
 StaticArray (const size_t size, const T *vec)
 create array of length size and store vec as pointer to memory More...
 
DofIteratorType begin ()
 iterator pointing to begin of array More...
 
ConstDofIteratorType begin () const
 const iterator pointing to begin of array More...
 
DofIteratorType end ()
 iterator pointing to end of array More...
 
ConstDofIteratorType end () const
 const iterator pointing to end of array More...
 
size_t size () const
 return number of enties of array More...
 
T & operator[] (const size_t i)
 return reference to entry i More...
 
const T & operator[] (const size_t i) const
 return reference to const entry i More...
 
ThisTypeoperator= (const ThisType &org)
 assign arrays More...
 
ThisTypeoperator+= (const ThisType &org)
 operator += More...
 
ThisTypeoperator-= (const ThisType &org)
 operator -= More...
 
ThisTypeoperator*= (const T scalar)
 operator *= multiplies array with a scalar More...
 
ThisTypeoperator/= (const T scalar)
 operator /= divides array with a scalar More...
 
ThisTypeoperator= (const T scalar)
 operator = assign all entrys to given scalar value More...
 
void axpy (const ThisType &org, const T scalar)
 axpy operation More...
 
void clear ()
 set all entries to zero More...
 
void memmove (const int length, const int oldStartIdx, const int newStartIdx)
 move memory from old to new destination More...
 
bool operator== (const ThisType &other) const
 
T * leakPointer ()
 return leak pointer for usage in BLAS routines More...
 
const T * leakPointer () const
 return leak pointer for usage in BLAS routines More...
 
T * data ()
 return leak pointer for usage in BLAS routines More...
 
const T * data () const
 return leak pointer for usage in BLAS routines More...
 
template<class StreamTraits >
bool write (OutStreamInterface< StreamTraits > &out) const
 write to stream More...
 
template<class StreamTraits >
bool read (InStreamInterface< StreamTraits > &in)
 write to stream More...
 
void print (std::ostream &s) const
 print array More...
 
template<>
void axpy (const ThisType &org, const double scalar)
 
template<>
void clear ()
 
template<>
void clear ()
 

Protected Types

typedef StaticArray< T > ThisType
 

Protected Member Functions

 StaticArray (const StaticArray &)
 

Protected Attributes

T * vec_
 
size_t size_
 

Detailed Description

template<class T>
class Dune::Fem::StaticArray< T >

Static Array Wrapper for simple C Vectors like double* and int*. This also works as base class for the MutableArray which is used to store the degrees of freedom.

Member Typedef Documentation

template<class T>
typedef T Dune::Fem::StaticArray< T >::block_type

definition conforming to ISTL

make compatible with std::vector

template<class T>
typedef GenericIterator<const ThisType, const T> Dune::Fem::StaticArray< T >::ConstDofIteratorType

Const DofIterator.

template<class T>
typedef GenericIterator<ThisType, T> Dune::Fem::StaticArray< T >::DofIteratorType

DofIterator.

template<class T>
typedef T Dune::Fem::StaticArray< T >::FieldType
template<class T>
typedef DofIteratorType Dune::Fem::StaticArray< T >::iterator

make compatible with std::vector

template<class T>
typedef size_t Dune::Fem::StaticArray< T >::size_type

type of unsigned integral type of indexing

template<class T>
typedef StaticArray<T> Dune::Fem::StaticArray< T >::ThisType
protected
template<class T>
typedef T Dune::Fem::StaticArray< T >::value_type

definition conforming to STL

Constructor & Destructor Documentation

template<class T>
Dune::Fem::StaticArray< T >::StaticArray ( const StaticArray< T > &  )
protected
template<class T>
Dune::Fem::StaticArray< T >::StaticArray ( const size_t  size,
T *  vec 
)
inlineexplicit

create array of length size and store vec as pointer to memory

template<class T>
Dune::Fem::StaticArray< T >::StaticArray ( const size_t  size,
const T *  vec 
)
inlineexplicit

create array of length size and store vec as pointer to memory

Member Function Documentation

template<class T>
void Dune::Fem::StaticArray< T >::axpy ( const ThisType org,
const T  scalar 
)
inline

axpy operation

template<>
void Dune::Fem::StaticArray< double >::axpy ( const ThisType org,
const double  scalar 
)
inline
template<class T>
DofIteratorType Dune::Fem::StaticArray< T >::begin ( )
inline
template<class T>
ConstDofIteratorType Dune::Fem::StaticArray< T >::begin ( ) const
inline

const iterator pointing to begin of array

template<class T>
void Dune::Fem::StaticArray< T >::clear ( )
inline

set all entries to zero

template<>
void Dune::Fem::StaticArray< int >::clear ( )
inline
template<>
void Dune::Fem::StaticArray< double >::clear ( )
inline
template<class T>
T* Dune::Fem::StaticArray< T >::data ( )
inline

return leak pointer for usage in BLAS routines

template<class T>
const T* Dune::Fem::StaticArray< T >::data ( ) const
inline

return leak pointer for usage in BLAS routines

template<class T>
DofIteratorType Dune::Fem::StaticArray< T >::end ( )
inline
template<class T>
ConstDofIteratorType Dune::Fem::StaticArray< T >::end ( ) const
inline

const iterator pointing to end of array

template<class T>
T* Dune::Fem::StaticArray< T >::leakPointer ( )
inline

return leak pointer for usage in BLAS routines

template<class T>
const T* Dune::Fem::StaticArray< T >::leakPointer ( ) const
inline

return leak pointer for usage in BLAS routines

template<class T>
void Dune::Fem::StaticArray< T >::memmove ( const int  length,
const int  oldStartIdx,
const int  newStartIdx 
)
inline

move memory from old to new destination

template<class T>
ThisType& Dune::Fem::StaticArray< T >::operator*= ( const T  scalar)
inline

operator *= multiplies array with a scalar

template<class T>
ThisType& Dune::Fem::StaticArray< T >::operator+= ( const ThisType org)
inline

operator +=

template<class T>
ThisType& Dune::Fem::StaticArray< T >::operator-= ( const ThisType org)
inline

operator -=

template<class T>
ThisType& Dune::Fem::StaticArray< T >::operator/= ( const T  scalar)
inline

operator /= divides array with a scalar

template<class T>
ThisType& Dune::Fem::StaticArray< T >::operator= ( const ThisType org)
inline

assign arrays

template<class T>
ThisType& Dune::Fem::StaticArray< T >::operator= ( const T  scalar)
inline

operator = assign all entrys to given scalar value

template<class T>
bool Dune::Fem::StaticArray< T >::operator== ( const ThisType other) const
inline

Comparison operator The comparison operator checks for object identity, i.e. if this and other are the same objects in memory rather than containing the same data

template<class T>
T& Dune::Fem::StaticArray< T >::operator[] ( const size_t  i)
inline

return reference to entry i

template<class T>
const T& Dune::Fem::StaticArray< T >::operator[] ( const size_t  i) const
inline

return reference to const entry i

template<class T>
void Dune::Fem::StaticArray< T >::print ( std::ostream &  s) const
inline

print array

template<class T>
template<class StreamTraits >
bool Dune::Fem::StaticArray< T >::read ( InStreamInterface< StreamTraits > &  in)
inline

write to stream

template<class T>
size_t Dune::Fem::StaticArray< T >::size ( ) const
inline
template<class T>
template<class StreamTraits >
bool Dune::Fem::StaticArray< T >::write ( OutStreamInterface< StreamTraits > &  out) const
inline

write to stream

Member Data Documentation

template<class T>
size_t Dune::Fem::StaticArray< T >::size_
protected
template<class T>
T* Dune::Fem::StaticArray< T >::vec_
protected

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