NGSolve  5.3
Public Member Functions | Protected Attributes
ngstd::FlatArray< T, TSIZE > Class Template Reference

A simple array container. More...

#include <array.hpp>

Inheritance diagram for ngstd::FlatArray< T, TSIZE >:
Inheritance graph
[legend]
Collaboration diagram for ngstd::FlatArray< T, TSIZE >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

INLINE FlatArray ()
 initialize array
template<typename TSIZE2 >
INLINE FlatArray (const FlatArray< T, TSIZE2 > &a2)
 copy constructor allows size-type conversion
INLINE FlatArray (TSIZE asize, T *adata)
 provide size and memory
INLINE FlatArray (TSIZE asize, LocalHeap &lh)
 memory from local heap
INLINE TSIZE Size () const
 the size
INLINE const FlatArrayoperator= (const T &val) const
 Fill array with value val.
INLINE const FlatArrayoperator= (const FlatArray &a2) const
 copies array
template<typename T2 >
INLINE const FlatArrayoperator= (const BaseArrayObject< T2 > &a2) const
INLINE const FlatArrayoperator= (const std::function< T(int)> &func) const
INLINE const FlatArrayAssign (const FlatArray &a2)
 copies pointers
INLINE const FlatArrayAssign (TSIZE asize, LocalHeap &lh)
 assigns memory from local heap
INLINE T & operator[] (TSIZE i) const
 Access array. range check by macro CHECK_RANGE.
INLINE T_Range< TSIZE > Range () const
INLINE const CArray< T > Addr (int pos)
INLINE T * operator+ (int pos)
T & Last () const
 access last element. check by macro CHECK_RANGE
INLINE const FlatArray< T > Part (int pos)
 takes sub-array starting from position pos
INLINE const FlatArray< T > Part (int pos, int subsize)
 takes subsize elements starting from position pos
INLINE FlatArray< T > Range (TSIZE start, TSIZE end) const
 takes range starting from position start of end-start elements
INLINE FlatArray< T, TSIZE > Range (T_Range< TSIZE > range) const
 takes range starting from position start of end-start elements
INLINE const FlatArray< T > operator[] (const IntRange range) const
 takes range starting from position start of end-start elements
template<typename TI1 >
IndirectArray< T,
BaseArrayObject< TI1 > > 
operator[] (const BaseArrayObject< TI1 > &ind_array) const
INLINE int Pos (const T &elem) const
 first position of element elem, returns -1 if element not contained in array
INLINE bool Contains (const T &elem) const
 does the array contain element elem ?
ArrayIterator< T, TSIZE > begin () const
ArrayIterator< T, TSIZE > end () const
FlatArray< T, TSIZE > OmpSplit () const

Protected Attributes

TSIZE size
 the size
T *__restrict data
 the data

Detailed Description

template<class T, class TSIZE>
class ngstd::FlatArray< T, TSIZE >

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


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