dune-fem 2.12-git
Loading...
Searching...
No Matches
Dune::Fem::DynamicArray< T, Allocator > Class Template Reference

An implementation of DenseVector which uses a C-array of dynamic size as storage. More...

#include <dune/fem/storage/dynamicarray.hh>

Inheritance diagram for Dune::Fem::DynamicArray< T, Allocator >:
Inheritance graph

Public Types

typedef Allocator AllocatorType
 
typedef BaseType::size_type size_type
 
typedef BaseType::value_type value_type
 
typedef value_type FieldType
 
typedef DenseMatVecTraits< ThisType >::container_type DofStorageType
 
typedef Traits::derived_type derived_type
 
typedef FieldTraits< value_type >::field_type field_type
 
typedef Traits::value_type block_type
 
typedef DenseIterator< DenseVector, value_typeIterator
 
typedef Iterator iterator
 
typedef DenseIterator< const DenseVector, const value_typeConstIterator
 
typedef ConstIterator const_iterator
 

Public Member Functions

 DynamicArray (const ThisType &other)
 copy constructor
 
 DynamicArray (size_type size, const value_type &value, AllocatorType allocator=AllocatorType())
 create array of length size with initialized values
 
 DynamicArray (size_type size=0, AllocatorType allocator=AllocatorType())
 create array of length size without initializing the values
 
void setMemoryFactor (double memFactor)
 set memory factor
 
 ~DynamicArray ()
 destructor
 
size_type capacity () const
 return number of total enties of array
 
void assign (const ThisType &org)
 assign arrays
 
ThisTypeoperator= (const ThisType &org)
 assign arrays
 
void resize (size_type nsize)
 
void resize (size_type nsize, const value_type &value)
 
void doResize (size_type nsize, bool initializeNewValues, const value_type &value=value_type())
 
void reserve (size_type mSize)
 
size_type usedMemorySize () const
 return size of vector in bytes
 
size_type size () const
 return size of array
 
value_typeoperator[] (size_type i)
 random access operator
 
const value_typeoperator[] (size_type i) const
 random access operator
 
void clear ()
 set all entries to 0
 
void memmove (size_type length, size_type oldStartIdx, size_type newStartIdx)
 move memory from old to new destination
 
bool operator== (const ThisType &other) const
 
constexpr bool operator== (const DenseVector< Other > &x) const
 
value_typedata ()
 return pointer to data
 
const value_typedata () const
 return pointer to data
 
constexpr value_typefront ()
 
constexpr const value_typefront () const
 
constexpr value_typeback ()
 
constexpr const value_typeback () const
 
constexpr bool empty () const
 
constexpr Iterator begin ()
 
constexpr ConstIterator begin () const
 
constexpr Iterator end ()
 
constexpr ConstIterator end () const
 
constexpr Iterator beforeEnd ()
 
constexpr ConstIterator beforeEnd () const
 
constexpr Iterator beforeBegin ()
 
constexpr ConstIterator beforeBegin () const
 
constexpr Iterator find (size_type i)
 
constexpr ConstIterator find (size_type i) const
 
constexpr derived_typeoperator+= (const DenseVector< Other > &x)
 
constexpr std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & operator+= (const ValueType &kk)
 
constexpr derived_typeoperator-= (const DenseVector< Other > &x)
 
constexpr std::enable_if< std::is_convertible< ValueType, value_type >::value, derived_type >::type & operator-= (const ValueType &kk)
 
constexpr derived_type operator+ (const DenseVector< Other > &b) const
 
constexpr derived_type operator- (const DenseVector< Other > &b) const
 
constexpr derived_type operator- () const
 
constexpr std::enable_if< std::is_convertible< FieldType, field_type >::value, derived_type >::type & operator*= (const FieldType &kk)
 
constexpr std::enable_if< std::is_convertible< FieldType, field_type >::value, derived_type >::type & operator/= (const FieldType &kk)
 
constexpr bool operator!= (const DenseVector< Other > &x) const
 
constexpr derived_typeaxpy (const field_type &a, const DenseVector< Other > &x)
 
constexpr PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType operator* (const DenseVector< Other > &x) const
 
constexpr PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType dot (const DenseVector< Other > &x) const
 
constexpr FieldTraits< value_type >::real_type one_norm () const
 
constexpr FieldTraits< value_type >::real_type one_norm_real () const
 
constexpr FieldTraits< value_type >::real_type two_norm () const
 
constexpr FieldTraits< value_type >::real_type two_norm2 () const
 
constexpr FieldTraits< vt >::real_type infinity_norm () const
 
constexpr FieldTraits< vt >::real_type infinity_norm () const
 
constexpr FieldTraits< vt >::real_type infinity_norm_real () const
 
constexpr FieldTraits< vt >::real_type infinity_norm_real () const
 
constexpr size_type N () const
 
constexpr size_type dim () const
 
std::ostreamoperator<< (std::ostream &s, const DenseVector< V > &v)
 

Static Public Attributes

static constexpr int blocklevel
 

Protected Types

typedef DynamicArray< T, AllocatorTypeThisType
 
typedef StaticArray< T > BaseType
 

Protected Member Functions

void adjustMemory (size_type mSize, bool initializeNewValues, const value_type &value=value_type())
 adjust the memory
 
void freeMemory ()
 

Protected Attributes

double memoryFactor_
 
size_type memSize_
 
AllocatorType allocator_
 
DofStorageType vec_
 
size_type size_
 

Detailed Description

template<class T, class Allocator>
class Dune::Fem::DynamicArray< T, Allocator >

An implementation of DenseVector which uses a C-array of dynamic size as storage.

Template Parameters
Tis the field type (use float, double, complex, etc)
Allocatoris the allocator type

Member Typedef Documentation

◆ AllocatorType

template<class T , class Allocator >
typedef Allocator Dune::Fem::DynamicArray< T, Allocator >::AllocatorType

◆ BaseType

template<class T , class Allocator >
typedef StaticArray<T> Dune::Fem::DynamicArray< T, Allocator >::BaseType
protected

◆ DofStorageType

template<class T >
typedef DenseMatVecTraits<ThisType>::container_type Dune::Fem::StaticArray< T >::DofStorageType
inherited

◆ FieldType

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

◆ size_type

template<class T , class Allocator >
typedef BaseType::size_type Dune::Fem::DynamicArray< T, Allocator >::size_type

◆ ThisType

template<class T , class Allocator >
typedef DynamicArray<T, AllocatorType> Dune::Fem::DynamicArray< T, Allocator >::ThisType
protected

◆ value_type

template<class T , class Allocator >
typedef BaseType::value_type Dune::Fem::DynamicArray< T, Allocator >::value_type

Constructor & Destructor Documentation

◆ DynamicArray() [1/3]

template<class T , class Allocator >
Dune::Fem::DynamicArray< T, Allocator >::DynamicArray ( const ThisType other)
inline

copy constructor

◆ DynamicArray() [2/3]

template<class T , class Allocator >
Dune::Fem::DynamicArray< T, Allocator >::DynamicArray ( size_type  size,
const value_type value,
AllocatorType  allocator = AllocatorType() 
)
inlineexplicit

create array of length size with initialized values

◆ DynamicArray() [3/3]

template<class T , class Allocator >
Dune::Fem::DynamicArray< T, Allocator >::DynamicArray ( size_type  size = 0,
AllocatorType  allocator = AllocatorType() 
)
inlineexplicit

create array of length size without initializing the values

◆ ~DynamicArray()

template<class T , class Allocator >
Dune::Fem::DynamicArray< T, Allocator >::~DynamicArray ( )
inline

destructor

Member Function Documentation

◆ adjustMemory()

template<class T , class Allocator >
void Dune::Fem::DynamicArray< T, Allocator >::adjustMemory ( size_type  mSize,
bool  initializeNewValues,
const value_type value = value_type() 
)
inlineprotected

adjust the memory

◆ assign()

template<class T , class Allocator >
void Dune::Fem::DynamicArray< T, Allocator >::assign ( const ThisType org)
inline

assign arrays

◆ capacity()

template<class T , class Allocator >
size_type Dune::Fem::DynamicArray< T, Allocator >::capacity ( ) const
inline

return number of total enties of array

◆ clear()

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

set all entries to 0

◆ data() [1/2]

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

return pointer to data

◆ data() [2/2]

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

return pointer to data

◆ doResize()

template<class T , class Allocator >
void Dune::Fem::DynamicArray< T, Allocator >::doResize ( size_type  nsize,
bool  initializeNewValues,
const value_type value = value_type() 
)
inline

◆ freeMemory()

template<class T , class Allocator >
void Dune::Fem::DynamicArray< T, Allocator >::freeMemory ( )
inlineprotected

◆ memmove()

template<class T >
void Dune::Fem::StaticArray< T >::memmove ( size_type  length,
size_type  oldStartIdx,
size_type  newStartIdx 
)
inlineinherited

move memory from old to new destination

◆ operator=()

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

assign arrays

◆ operator==()

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

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

◆ operator[]() [1/2]

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

random access operator

◆ operator[]() [2/2]

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

random access operator

◆ reserve()

template<class T , class Allocator >
void Dune::Fem::DynamicArray< T, Allocator >::reserve ( size_type  mSize)
inline

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

◆ resize() [1/2]

template<class T , class Allocator >
void Dune::Fem::DynamicArray< T, Allocator >::resize ( size_type  nsize)
inline

resize vector with new size nsize if nsize is smaller then actual memSize, size is just set to new value

◆ resize() [2/2]

template<class T , class Allocator >
void Dune::Fem::DynamicArray< T, Allocator >::resize ( size_type  nsize,
const value_type value 
)
inline

resize vector with new size nsize if nsize is smaller then actual memSize, size is just set to new value

◆ setMemoryFactor()

template<class T , class Allocator >
void Dune::Fem::DynamicArray< T, Allocator >::setMemoryFactor ( double  memFactor)
inline

set memory factor

◆ size()

template<class T >
size_type Dune::Fem::StaticArray< T >::size ( ) const
inlineinherited

return size of array

◆ usedMemorySize()

template<class T , class Allocator >
size_type Dune::Fem::DynamicArray< T, Allocator >::usedMemorySize ( ) const
inline

return size of vector in bytes

Member Data Documentation

◆ allocator_

template<class T , class Allocator >
AllocatorType Dune::Fem::DynamicArray< T, Allocator >::allocator_
protected

◆ memoryFactor_

template<class T , class Allocator >
double Dune::Fem::DynamicArray< T, Allocator >::memoryFactor_
protected

◆ memSize_

template<class T , class Allocator >
size_type Dune::Fem::DynamicArray< T, Allocator >::memSize_
protected

◆ size_

template<class T >
size_type Dune::Fem::StaticArray< T >::size_
protectedinherited

◆ vec_

template<class T >
DofStorageType Dune::Fem::StaticArray< T >::vec_
protectedinherited

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