NGSolve
4.9
|
A simple array container. More...
#include <array.hpp>
Public Member Functions | |
FlatArray () | |
initialize array | |
FlatArray (TSIZE asize, T *adata) | |
provide size and memory | |
FlatArray (TSIZE asize, LocalHeap &lh) | |
memory from local heap | |
TSIZE | Size () const |
the size | |
const FlatArray & | operator= (const T &val) const |
Fill array with value val. | |
const FlatArray & | operator= (const FlatArray &a2) const |
copies array | |
template<typename T2 , typename TA > | |
const FlatArray & | operator= (const BaseArrayObject< T2, TA > &a2) const |
T & | operator[] (TSIZE i) const |
Access array. range check by macro CHECK_RANGE. | |
const CArray< T > | Addr (int pos) |
T & | Last () const |
access last element. check by macro CHECK_RANGE | |
const FlatArray< T > | Part (int pos) |
takes sub-array starting from position pos | |
const FlatArray< T > | Part (int pos, int subsize) |
takes subsize elements starting from position pos | |
const FlatArray< T > | Range (int start, int end) const |
takes range starting from position start of end-start elements | |
const FlatArray< T > | Range (class IntRange range) const |
takes range starting from position start of end-start elements | |
const FlatArray< T > | operator[] (const IntRange range) const |
takes range starting from position start of end-start elements | |
template<typename TI1 , typename TI2 > | |
IndirectArray< T, BaseArrayObject< TI1, TI2 > > | operator[] (const BaseArrayObject< TI1, TI2 > &ind_array) const |
int | Pos (const T &elem) const |
first position of element elem, returns -1 if element not contained in array | |
bool | Contains (const T &elem) const |
does the array contain element elem ? | |
Protected Attributes | |
TSIZE | size |
the size | |
T * | data |
the data |
A simple array container.
Array represented by size and data-pointer. No memory allocation and deallocation, must be provided by user. Helper functions for printing. Optional range check by macro CHECK_RANGE