ug4
|
#include <variable_array.h>
Public Types | |
typedef size_t | size_type |
typedef variable_type | storage_type |
typedef T | value_type |
Public Member Functions | |
T & | at (size_type i) |
const T & | at (size_type i) const |
size_type | capacity () const |
T & | operator[] (size_type i) |
const T & | operator[] (size_type i) const |
bool | reserve (size_type n) const |
bool | resize (size_type n, bool bCopyValues=true) |
size_type | size () const |
VariableArray1 () | |
VariableArray1 (const VariableArray1< T > &other) | |
VariableArray1 (size_type n_) | |
~VariableArray1 () | |
Protected Attributes | |
size_type | n |
T * | values |
Friends | |
template<typename _T > | |
std::ostream & | operator<< (std::ostream &out, const VariableArray1< _T > &arr) |
VariableArray1 is a one-dimensional array which supports most of the interface of std::vector (some functions and iterators have to be added). You can use VariableArray1 in DenseVector to get a variable size mathematical Vector. Use storage_traits<type>::is_static to distinguish between fixed and variable vectors. There is a small difference between std::vector and VariableArray1: VariableArray1::capacity == VariableArray1::size, that means there is no capacity buffering. This might be helpful if you have millions of instances of VariableArray1, since you will have a) exactly as many memory allocated as you need b) sizeof(VariableArray1) < sizeof(std::vector) ( 8 vs. 12 on 32-bit systems).
T | type of object in Array (i.e. double) |
typedef size_t ug::VariableArray1< T >::size_type |
typedef variable_type ug::VariableArray1< T >::storage_type |
typedef T ug::VariableArray1< T >::value_type |
ug::VariableArray1< T >::VariableArray1 |
ug::VariableArray1< T >::VariableArray1 | ( | size_type | n_ | ) |
References resize().
ug::VariableArray1< T >::VariableArray1 | ( | const VariableArray1< T > & | other | ) |
ug::VariableArray1< T >::~VariableArray1 |
|
inline |
References ug::VariableArray1< T >::operator[]().
|
inline |
References ug::VariableArray1< T >::operator[]().
|
inline |
|
inline |
|
inline |
Referenced by ug::VariableArray1< T >::at().
|
inline |
|
inline |
References UG_ASSERT.
Referenced by ug::LocalIndexSubspace< TDomain, TAlgebra, TObject >::extract_rhs(), ug::LocalDoFSubspace< TDomain, TAlgebra, TObject >::extract_rhs(), ug::LocalIndexSubspace< TDomain, TAlgebra, TObject >::update_solution(), and ug::LocalDoFSubspace< TDomain, TAlgebra, TObject >::update_solution().
|
inline |
Referenced by ug::operator<<().
|
friend |
|
protected |
|
protected |