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

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

Inheritance diagram for Dune::Fem::MutableArray< T, AllocatorType >:
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

 MutableArray ()
 create array of length 0 More...
 
 MutableArray (const MutableArray &other)
 copy constructor More...
 
 MutableArray (const size_t size)
 create array of length size More...
 
void setMemoryFactor (const double memFactor)
 set memory factor More...
 
 ~MutableArray ()
 Destructor. More...
 
size_t capacity () const
 return number of total enties of array More...
 
ThisTypeoperator= (const ThisType &org)
 assign arrays More...
 
void resize (size_t nsize)
 
void reserve (size_t mSize)
 
size_t usedMemorySize () const
 return size of vector in bytes 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)
 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...
 
void axpy (const ThisType &org, const T scalar)
 axpy operation More...
 
template<>
void axpy (const ThisType &org, const double scalar)
 
void clear ()
 set all entries to zero More...
 
template<>
void clear ()
 
template<>
void clear ()
 
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...
 

Protected Types

typedef MutableArray< T, AllocatorType > ThisType
 
typedef StaticArray< T > BaseType
 

Protected Member Functions

void adjustMemory (size_t mSize)
 adjust the memory More...
 
void freeMemory ()
 

Protected Attributes

double memoryFactor_
 
size_t memSize_
 
T * vec_
 
size_t size_
 

Detailed Description

template<class T, class AllocatorType>
class Dune::Fem::MutableArray< T, AllocatorType >

MutableArray is the array that a discrete functions sees. If a discrete function is created, then it is signed in by the function space and the return value is a MemObject. This MemObject contains a MutableArrayMemory which is then as reference given to the MutableArray of the DiscreteFunction. The MutableArray is only a wrapper class for MutableArrayMemory where we dont know the type of the dofs only the size of one dof. Therefore we have this wrapper class for cast to the right type.

Member Typedef Documentation

template<class T, class AllocatorType>
typedef StaticArray<T> Dune::Fem::MutableArray< T, AllocatorType >::BaseType
protected
template<class T>
typedef T Dune::Fem::StaticArray< T >::block_type
inherited

definition conforming to ISTL

template<class T>
typedef ConstDofIteratorType Dune::Fem::StaticArray< T >::const_iterator
inherited

make compatible with std::vector

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

Const DofIterator.

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

DofIterator.

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

make compatible with std::vector

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

type of unsigned integral type of indexing

template<class T, class AllocatorType>
typedef MutableArray<T, AllocatorType> Dune::Fem::MutableArray< T, AllocatorType >::ThisType
protected
template<class T>
typedef T Dune::Fem::StaticArray< T >::value_type
inherited

definition conforming to STL

Constructor & Destructor Documentation

template<class T, class AllocatorType>
Dune::Fem::MutableArray< T, AllocatorType >::MutableArray ( )
inline

create array of length 0

template<class T, class AllocatorType>
Dune::Fem::MutableArray< T, AllocatorType >::MutableArray ( const MutableArray< T, AllocatorType > &  other)
inline

copy constructor

template<class T, class AllocatorType>
Dune::Fem::MutableArray< T, AllocatorType >::MutableArray ( const size_t  size)
inline

create array of length size

template<class T, class AllocatorType>
Dune::Fem::MutableArray< T, AllocatorType >::~MutableArray ( )
inline

Destructor.

Member Function Documentation

template<class T, class AllocatorType>
void Dune::Fem::MutableArray< T, AllocatorType >::adjustMemory ( size_t  mSize)
inlineprotected

adjust the memory

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

axpy operation

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

const iterator pointing to begin of array

template<class T, class AllocatorType>
size_t Dune::Fem::MutableArray< T, AllocatorType >::capacity ( ) const
inline

return number of total enties of array

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

set all entries to zero

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

return leak pointer for usage in BLAS routines

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

return leak pointer for usage in BLAS routines

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

const iterator pointing to end of array

template<class T, class AllocatorType>
void Dune::Fem::MutableArray< T, AllocatorType >::freeMemory ( )
inlineprotected
template<class T>
T* Dune::Fem::StaticArray< T >::leakPointer ( )
inlineinherited

return leak pointer for usage in BLAS routines

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

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 
)
inlineinherited

move memory from old to new destination

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

operator *= multiplies array with a scalar

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

operator +=

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

operator -=

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

operator /= divides array with a scalar

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

assign arrays

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

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)
inlineinherited

return reference to entry i

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

return reference to const entry i

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

print array

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

write to stream

template<class T, class AllocatorType>
void Dune::Fem::MutableArray< T, AllocatorType >::reserve ( size_t  mSize)
inline

reserve vector size with new mSize if mSize is smaller then actual memSize, then nothing is done

Referenced by Dune::Fem::CommunicationIndexMap::reserve(), and Dune::Fem::MutableBlockVector< MutableArray< F >, BlockSize >::reserve().

template<class T, class AllocatorType>
void Dune::Fem::MutableArray< T, AllocatorType >::resize ( size_t  nsize)
inline
template<class T, class AllocatorType>
void Dune::Fem::MutableArray< T, AllocatorType >::setMemoryFactor ( const double  memFactor)
inline
template<class T>
size_t Dune::Fem::StaticArray< T >::size ( ) const
inlineinherited
template<class T, class AllocatorType>
size_t Dune::Fem::MutableArray< T, AllocatorType >::usedMemorySize ( ) const
inline

return size of vector in bytes

Referenced by Dune::Fem::SpecialArrayFeatures< MutableArray< ValueType > >::used().

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

write to stream

Member Data Documentation

template<class T, class AllocatorType>
double Dune::Fem::MutableArray< T, AllocatorType >::memoryFactor_
protected
template<class T, class AllocatorType>
size_t Dune::Fem::MutableArray< T, AllocatorType >::memSize_
protected
template<class T>
size_t Dune::Fem::StaticArray< T >::size_
protectedinherited
template<class T>
T* Dune::Fem::StaticArray< T >::vec_
protectedinherited

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