dune-fem 2.8.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
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
 

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
 
value_typedata ()
 return pointer to data
 
const value_typedata () const
 return pointer to data
 

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: