Sierra Toolkit  Version of the Day
sierra::FArray< ElementType, Dimension > Class Template Reference

Multidimensional array of contiguous memory. The memory is not owned by the array, but container access semantics are enforced, i.e. const Array<> elements cannot be assigned to. More...

#include <FArray.hpp>

Inheritance diagram for sierra::FArray< ElementType, Dimension >:

Public Types

enum  { NumDim = Dimension }
 
typedef ElementType value_type
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef value_type * pointer
 
typedef const value_type * const_pointer
 
typedef value_type & reference
 
typedef const value_type & const_reference
 
typedef pointer iterator
 
typedef const_pointer const_iterator
 
typedef std::reverse_iterator< iterator > reverse_iterator
 
typedef std::reverse_iterator< const_iterator > const_reverse_iterator
 
typedef FArray< ElementType, Dimension > SelfType
 
typedef FArrayContainer< ElementType, Dimension > Container
 
typedef FArray< ElementType, Dimension - 1 > Trunc
 

Public Member Functions

const unsigned * dimension () const
 
const unsigned * stride () const
 
void array_dimension_verify (unsigned l_dimension, unsigned value, unsigned upper) const
 
template<unsigned I>
unsigned dimension () const
 
template<unsigned I>
unsigned stride () const
 
unsigned dimension (const unsigned i) const
 
unsigned stride (const unsigned i) const
 
unsigned size () const
 
bool operator== (const SelfType &a) const
 
template<typename T >
bool operator== (const FArray< T, Dimension > &a) const
 
bool operator!= (const SelfType &a) const
 
template<typename T >
bool operator!= (const FArray< T, Dimension > &a) const
 
value_type & operator() (const Index &index)
 
value_type & operator() (const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6, const unsigned i7)
 
value_type & operator() (const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6)
 
value_type & operator() (const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5)
 
value_type & operator() (const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4)
 
value_type & operator() (const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3)
 
value_type & operator() (const unsigned i0, const unsigned i1, const unsigned i2)
 
value_type & operator() (const unsigned i0, const unsigned i1)
 
value_type & operator() (const unsigned i0)
 
value_type * ptr ()
 
value_type & operator[] (unsigned i)
 
const value_type & operator() (const Index &index) const
 
const value_type & operator() (const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6, const unsigned i7) const
 
const value_type & operator() (const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6) const
 
const value_type & operator() (const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5) const
 
const value_type & operator() (const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4) const
 
const value_type & operator() (const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3) const
 
const value_type & operator() (const unsigned i0, const unsigned i1, const unsigned i2) const
 
const value_type & operator() (const unsigned i0, const unsigned i1) const
 
const value_type & operator() (const unsigned i0) const
 
value_type * ptr () const
 
const value_type & operator[] (unsigned i) const
 
bool verify_dimension (const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6, const unsigned n7) const
 
bool verify_dimension (const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6) const
 
bool verify_dimension (const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5) const
 
bool verify_dimension (const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4) const
 
bool verify_dimension (const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3) const
 
bool verify_dimension (const unsigned n0, const unsigned n1, const unsigned n2) const
 
bool verify_dimension (const unsigned n0, const unsigned n1) const
 
bool verify_dimension (const unsigned n0) const
 
unsigned set_dim (const unsigned d[])
 
unsigned set_dim (const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6, const unsigned n7)
 
unsigned set_dim (const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6)
 
unsigned set_dim (const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5)
 
unsigned set_dim (const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4)
 
unsigned set_dim (const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3)
 
unsigned set_dim (const unsigned n0, const unsigned n1, const unsigned n2)
 
unsigned set_dim (const unsigned n0, const unsigned n1)
 
unsigned set_dim (const unsigned n0)
 
unsigned set_dim (const SelfType &a)
 
 FArray (const SelfType &a)
 
SelfTypeoperator= (SelfType const &a)
 
template<typename T >
 FArray (const FArray< T, Dimension > &a)
 
 FArray (value_type *const l_ptr, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6, const unsigned n7)
 
 FArray (value_type *const l_ptr, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6)
 
 FArray (value_type *const l_ptr, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5)
 
 FArray (value_type *const l_ptr, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4)
 
 FArray (value_type *const l_ptr, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3)
 
 FArray (value_type *const l_ptr, const unsigned n0, const unsigned n1, const unsigned n2)
 
 FArray (value_type *const l_ptr, const unsigned n0, const unsigned n1)
 
 FArray (value_type *const l_ptr, const unsigned n0)
 
 FArray (value_type *const l_ptr, const unsigned n[NumDim])
 
void set (const SelfType &a)
 
void set (value_type *const l_ptr, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6, const unsigned n7)
 
void set (value_type *const l_ptr, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6)
 
void set (value_type *const l_ptr, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5)
 
void set (value_type *const l_ptr, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4)
 
void set (value_type *const l_ptr, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3)
 
void set (value_type *const l_ptr, const unsigned n0, const unsigned n1, const unsigned n2)
 
void set (value_type *const l_ptr, const unsigned n0, const unsigned n1)
 
void set (value_type *const l_ptr, const unsigned n0)
 
void set (value_type *const l_ptr, const unsigned n[NumDim])
 
Trunc dive (int i)
 
const Trunc dive (int i) const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
void dimensions (const_iterator it, Index &index) const
 
template<typename T >
void copy (const FArray< T, Dimension > &a)
 
template<typename T >
void fill (const T &value)
 

Protected Attributes

value_type * m_ptr
 
unsigned m_dim [NumDim]
 
unsigned m_stride [NumDim+1]
 

Detailed Description

template<class ElementType, int Dimension>
class sierra::FArray< ElementType, Dimension >

Multidimensional array of contiguous memory. The memory is not owned by the array, but container access semantics are enforced, i.e. const Array<> elements cannot be assigned to.

Indexing via 'operator()'

Elements of an array can be accessed via the () operator, where an index is provided for each dimension of the array. The number of dimensions is enforced at compile time; however, enforcement of the range of the indices is only performed at runtime in debug mode, i.e. 'NDEBUG' is not defined.

FArray<double,4> a(mem, n0, n1, n2, n3); a(i0, i1, i2, i3) = 24 ;

Construction with a block of memory

An array is created by providing it with memory address and dimensions by which that memory is to be viewed.

FArray(pointer, ndim0, ndim1, ndim2, ...);

Shallow copy construction

The copy constructor is a shallow copy. The constructed array is just another a view into the same memory as the input array. This is the preferred method of passing arrays as access required less memory indirection.

Definition at line 78 of file FArray.hpp.

Member Function Documentation

◆ dimension()

template<class ElementType, int Dimension>
unsigned sierra::FArray< ElementType, Dimension >::dimension ( const unsigned  i) const
inline

Dimensions defined at construction

Definition at line 383 of file FArray.hpp.


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