Overture  Version 25
Public Member Functions | List of all members
ArraySimpleFixed< T, d1, d2, d3, d4, d5 > Class Template Reference

simple fixed size arrays of up to rank 4 More...

#include <ArraySimpleFixed.h>

Public Member Functions

 ArraySimpleFixed ()
 default constructor, does nothing
 
 ArraySimpleFixed (const ArraySimpleFixed< T, d1, d2, d3, d4, d5 > &a)
 copy constructor, copies contents of source into sink
 
 ~ArraySimpleFixed ()
 destructor
 
int size () const
 get the total size of the array
 
int size (const int &i) const
 get the size of the array along one dimension
 
int rank () const
 get the rank of the array
 
T * ptr ()
 return a pointer to the data
 
ArraySimpleFixed< T, d1, d2,
d3, d4, d5 > & 
operator= (const ArraySimpleFixed< T, d1, d2, d3, d4, d5 > &a)
 assignment operator, copy data from source array into the current instance
 
ArraySimpleFixed< T, d1, d2,
d3, d4, d5 > & 
operator= (const T &a)
 
T & operator[] (const int &i)
 one dimensional index operator
 
const T & operator[] (const int &i) const
 const one dimensional index operator
 
T & operator() (const int &i1, const int &i2=0, const int &i3=0, const int &i4=0, const int &i5=0)
 multidimensional index operator
 
const T & operator() (const int &i1, const int &i2=0, const int &i3=0, const int &i4=0, const int &i5=0) const
 const multidimensional index operator
 

Detailed Description

template<class T, int d1, int d2 = 1, int d3 = 1, int d4 = 1, int d5 = 1>
class ArraySimpleFixed< T, d1, d2, d3, d4, d5 >

simple fixed size arrays of up to rank 4

Provides an efficient wrapper for statically declared arrays (eg a[2][3].) The class also provides column major ordering and access to the data pointer. It should support ranks up to MAXRANK.

Constructor & Destructor Documentation

template<class T, int d1, int d2 = 1, int d3 = 1, int d4 = 1, int d5 = 1>
ArraySimpleFixed< T, d1, d2, d3, d4, d5 >::ArraySimpleFixed ( )
inline

default constructor, does nothing

template<class T, int d1, int d2 = 1, int d3 = 1, int d4 = 1, int d5 = 1>
ArraySimpleFixed< T, d1, d2, d3, d4, d5 >::ArraySimpleFixed ( const ArraySimpleFixed< T, d1, d2, d3, d4, d5 > &  a)
inline

copy constructor, copies contents of source into sink

template<class T, int d1, int d2 = 1, int d3 = 1, int d4 = 1, int d5 = 1>
ArraySimpleFixed< T, d1, d2, d3, d4, d5 >::~ArraySimpleFixed ( )
inline

destructor

Member Function Documentation

template<class T, int d1, int d2 = 1, int d3 = 1, int d4 = 1, int d5 = 1>
T& ArraySimpleFixed< T, d1, d2, d3, d4, d5 >::operator() ( const int &  i1,
const int &  i2 = 0,
const int &  i3 = 0,
const int &  i4 = 0,
const int &  i5 = 0 
)
inline

multidimensional index operator

Parameters
i1rank 1 index
i2rank 2 index, range check fails if rank is 1 and i2>0
i3rank 3 index, range check fails if rank is 2 and i3>0
i4rank 4 index, range check fails if rank is 3 and i4>0
i5rank 5 index, range check fails if rank is 4 and i5>0
Returns
a reference to data item at location (i1,i2,i3,i4)
template<class T, int d1, int d2 = 1, int d3 = 1, int d4 = 1, int d5 = 1>
const T& ArraySimpleFixed< T, d1, d2, d3, d4, d5 >::operator() ( const int &  i1,
const int &  i2 = 0,
const int &  i3 = 0,
const int &  i4 = 0,
const int &  i5 = 0 
) const
inline

const multidimensional index operator

Parameters
i1rank 1 index
i2rank 2 index, range check fails if rank is 1 and i2>0
i3rank 3 index, range check fails if rank is 2 and i3>0
i4rank 4 index, range check fails if rank is 3 and i4>0
Returns
a reference to data item at location (i1,i2,i3,i4)
template<class T, int d1, int d2 = 1, int d3 = 1, int d4 = 1, int d5 = 1>
ArraySimpleFixed<T,d1,d2,d3,d4,d5>& ArraySimpleFixed< T, d1, d2, d3, d4, d5 >::operator= ( const ArraySimpleFixed< T, d1, d2, d3, d4, d5 > &  a)
inline

assignment operator, copy data from source array into the current instance

Parameters
athe source array
Returns
the sink array
template<class T, int d1, int d2 = 1, int d3 = 1, int d4 = 1, int d5 = 1>
ArraySimpleFixed<T,d1,d2,d3,d4,d5>& ArraySimpleFixed< T, d1, d2, d3, d4, d5 >::operator= ( const T &  a)
inline
template<class T, int d1, int d2 = 1, int d3 = 1, int d4 = 1, int d5 = 1>
T& ArraySimpleFixed< T, d1, d2, d3, d4, d5 >::operator[] ( const int &  i)
inline

one dimensional index operator

index into the array in a one dimensional manner, ignoring the dimensions of the array

Parameters
iindex into the data
Returns
a reference to data item i
template<class T, int d1, int d2 = 1, int d3 = 1, int d4 = 1, int d5 = 1>
const T& ArraySimpleFixed< T, d1, d2, d3, d4, d5 >::operator[] ( const int &  i) const
inline

const one dimensional index operator

index into the array in a one dimensional manner, ignoring the dimensions of the array

Parameters
iindex into the data
Returns
a const reference to data item i
template<class T, int d1, int d2 = 1, int d3 = 1, int d4 = 1, int d5 = 1>
T* ArraySimpleFixed< T, d1, d2, d3, d4, d5 >::ptr ( )
inline
template<class T, int d1, int d2 = 1, int d3 = 1, int d4 = 1, int d5 = 1>
int ArraySimpleFixed< T, d1, d2, d3, d4, d5 >::rank ( ) const
inline

get the rank of the array

template<class T, int d1, int d2 = 1, int d3 = 1, int d4 = 1, int d5 = 1>
int ArraySimpleFixed< T, d1, d2, d3, d4, d5 >::size ( ) const
inline
template<class T, int d1, int d2 = 1, int d3 = 1, int d4 = 1, int d5 = 1>
int ArraySimpleFixed< T, d1, d2, d3, d4, d5 >::size ( const int &  i) const
inline

get the size of the array along one dimension

Parameters
ithe dimension whose size is requested
Returns
the size of the array along dimension i

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