NGSolve  4.9
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 >:
ngstd::BaseArrayObject< FlatArray< T > > ngstd::Array< int > ngstd::Array< IntegrationPoint > ngstd::Array< TM > ngstd::Array< T, TSIZE > ngfem::IntegrationRule ngfem::IntegrationRuleTP< D >

List of all members.

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 FlatArrayoperator= (const T &val) const
 Fill array with value val.
const FlatArrayoperator= (const FlatArray &a2) const
 copies array
template<typename T2 , typename TA >
const FlatArrayoperator= (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

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: