Schnek
schnek::Grid< T, rank, CheckingPolicy, StoragePolicy > Class Template Reference

A multidimensional grid that stores simple data. More...

#include <grid.hpp>

Inheritance diagram for schnek::Grid< T, rank, CheckingPolicy, StoragePolicy >:
Collaboration diagram for schnek::Grid< T, rank, CheckingPolicy, StoragePolicy >:

Public Types

enum  { Rank = rank }
 
typedef T value_type
 
typedef Array< int, rank > IndexType
 
typedef Range< int, rank > RangeType
 
typedef Grid< T, rank, CheckingPolicy, StoragePolicy > GridType
 
typedef internal::GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > BaseType
 
- Public Types inherited from schnek::internal::GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > >
enum  
 
typedef T value_type
 
typedef CheckingPolicy< rank > CheckingPolicyType
 
typedef StoragePolicy< T, rank > StoragePolicyType
 
typedef CheckingPolicy< rank > ::IndexType IndexType
 
typedef StoragePolicy< T, rank > ::RangeType RangeType
 
typedef GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > GridBaseType
 

Public Member Functions

 Grid ()
 default constructor creates an empty grid
 
 Grid (const Grid &)=default
 copy constructor
 
 Grid (const IndexType &size)
 constructor, which builds Grid of size size[0] x ... x size[rank-1] More...
 
 Grid (const IndexType &low, const IndexType &high)
 
 Grid (const RangeType &range)
 
GridTypeoperator= (const T &val)
 
GridTypeoperator= (const GridType &grid)
 
template<typename T2 , class CheckingPolicy2 , class StoragePolicy2 >
GridTypeoperator= (const internal::GridBase< T2, rank, CheckingPolicy2, StoragePolicy2 > &grid)
 
- Public Member Functions inherited from schnek::internal::GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > >
 GridBase ()
 Default constructor.
 
 GridBase (const GridBase &)=default
 Copy constructor.
 
 GridBase (const Array< int, rank, ArrayCheckingPolicy > &size)
 
 GridBase (const Array< int, rank, ArrayCheckingPolicy > &low, const Array< int, rank, ArrayCheckingPolicy > &high)
 
 GridBase (const Range< int, rank, ArrayCheckingPolicy > &range)
 
SCHNEK_INLINE T & operator[] (const Array< int, rank, ArrayCheckingPolicy > &pos)
 
SCHNEK_INLINE T operator[] (const Array< int, rank, ArrayCheckingPolicy > &pos) const
 
SCHNEK_INLINE T & operator[] (const ArrayExpression< Operator, Length > &pos)
 
SCHNEK_INLINE T operator[] (const ArrayExpression< Operator, Length > &pos) const
 
SCHNEK_INLINE T & operator[] (int i)
 
SCHNEK_INLINE T operator[] (int i) const
 
SCHNEK_INLINE T & operator() (int i)
 
SCHNEK_INLINE T operator() (int i) const
 
SCHNEK_INLINE T & operator() (int i, int j)
 
SCHNEK_INLINE T operator() (int i, int j) const
 
SCHNEK_INLINE T & operator() (int i, int j, int k)
 
SCHNEK_INLINE T operator() (int i, int j, int k) const
 
SCHNEK_INLINE T & operator() (int i, int j, int k, int l)
 
SCHNEK_INLINE T operator() (int i, int j, int k, int l) const
 
SCHNEK_INLINE T & operator() (int i, int j, int k, int l, int m)
 
SCHNEK_INLINE T operator() (int i, int j, int k, int l, int m) const
 
SCHNEK_INLINE T & operator() (int i, int j, int k, int l, int m, int o)
 
SCHNEK_INLINE T operator() (int i, int j, int k, int l, int m, int o) const
 
SCHNEK_INLINE T & operator() (int i, int j, int k, int l, int m, int o, int p)
 
SCHNEK_INLINE T operator() (int i, int j, int k, int l, int m, int o, int p) const
 
SCHNEK_INLINE T & operator() (int i, int j, int k, int l, int m, int o, int p, int q)
 
SCHNEK_INLINE T operator() (int i, int j, int k, int l, int m, int o, int p, int q) const
 
SCHNEK_INLINE T & operator() (int i, int j, int k, int l, int m, int o, int p, int q, int r)
 
SCHNEK_INLINE T operator() (int i, int j, int k, int l, int m, int o, int p, int q, int r) const
 
SCHNEK_INLINE T & operator() (int i, int j, int k, int l, int m, int o, int p, int q, int r, int s)
 
SCHNEK_INLINE T operator() (int i, int j, int k, int l, int m, int o, int p, int q, int r, int s) const
 
SCHNEK_INLINE GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > & operator= (const T &val)
 
SCHNEK_INLINE GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > & operator= (const GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > &val)=default
 
SCHNEK_INLINE GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > & operator-= (GridBase< T2, rank, CheckingPolicy2, StoragePolicy< T, rank > > &)
 
SCHNEK_INLINE GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > & operator-= (GridBase< T2, rank, CheckingPolicy2, StoragePolicy2 > &)
 
SCHNEK_INLINE GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > & operator+= (GridBase< T2, rank, CheckingPolicy2, StoragePolicy< T, rank > > &)
 
SCHNEK_INLINE GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > & operator+= (GridBase< T2, rank, CheckingPolicy2, StoragePolicy2 > &)
 
void resize (const IndexType &size)
 Resize to size[0] x ... x size[rank-1]. More...
 
void resize (const IndexType &low, const IndexType &high)
 Resize to lower indices low[0],...,low[rank-1] and upper indices high[0],...,high[rank-1]. More...
 
void resize (const RangeType &range)
 Resize to lower indices range.getLo(0),...,range.getLo(rank-1) and upper indices range.getHi(0),...,range.getHi(rank-1) More...
 
void resize (const GridBase< T2, rank, CheckingPolicy2, StoragePolicy2 > &grid)
 

Detailed Description

template<typename T, size_t rank, template< size_t > class CheckingPolicy = GridNoArgCheck, template< typename, size_t > class StoragePolicy = SingleArrayGridStorage>
class schnek::Grid< T, rank, CheckingPolicy, StoragePolicy >

A multidimensional grid that stores simple data.

Template Parameters
Tthe data type of the grid
rankthe dimensionality of the grid
CheckingPolicya policy for checking index access operations
StoragePolicya policy that defines how the data is stored in memory

Constructor & Destructor Documentation

◆ Grid() [1/3]

template<typename T, size_t rank, template< size_t > class CheckingPolicy = GridNoArgCheck, template< typename, size_t > class StoragePolicy = SingleArrayGridStorage>
schnek::Grid< T, rank, CheckingPolicy, StoragePolicy >::Grid ( const IndexType size)

constructor, which builds Grid of size size[0] x ... x size[rank-1]

Example: {verbatim} Grid<double,2>::IndexType size=(512,512); Grid<double,2> m(size); {verbatim}

The ranges then extend from 0 to size[i]-1

◆ Grid() [2/3]

template<typename T, size_t rank, template< size_t > class CheckingPolicy = GridNoArgCheck, template< typename, size_t > class StoragePolicy = SingleArrayGridStorage>
schnek::Grid< T, rank, CheckingPolicy, StoragePolicy >::Grid ( const IndexType low,
const IndexType high 
)

constructor, which builds Grid with lower indices low[0],...,low[rank-1] and upper indices high[0],...,high[rank-1]

Example: {verbatim} Grid<double,2>::IndexType low(-5,-10); Grid<double,2>::IndexType high(15,36); Grid<double,2> m(l,h); {verbatim}

The ranges then extend from low[i] to high[i]

◆ Grid() [3/3]

template<typename T, size_t rank, template< size_t > class CheckingPolicy = GridNoArgCheck, template< typename, size_t > class StoragePolicy = SingleArrayGridStorage>
schnek::Grid< T, rank, CheckingPolicy, StoragePolicy >::Grid ( const RangeType range)

constructor, which builds Grid with range given by range

Example: {verbatim} Grid<double,2>::IndexType low(-5,-10); Grid<double,2>::IndexType high(15,36); Grid<double,2>::RangeType range(low, high); Grid<double,2> m(range); {verbatim}

The ranges then extend from low[i] to high[i]

Member Function Documentation

◆ operator=() [1/3]

template<typename T, size_t rank, template< size_t > class CheckingPolicy = GridNoArgCheck, template< typename, size_t > class StoragePolicy = SingleArrayGridStorage>
GridType& schnek::Grid< T, rank, CheckingPolicy, StoragePolicy >::operator= ( const T &  val)
inline

assign another grid

◆ operator=() [2/3]

template<typename T, size_t rank, template< size_t > class CheckingPolicy = GridNoArgCheck, template< typename, size_t > class StoragePolicy = SingleArrayGridStorage>
GridType& schnek::Grid< T, rank, CheckingPolicy, StoragePolicy >::operator= ( const GridType grid)
inline

assign another grid

◆ operator=() [3/3]

template<typename T, size_t rank, template< size_t > class CheckingPolicy = GridNoArgCheck, template< typename, size_t > class StoragePolicy = SingleArrayGridStorage>
template<typename T2 , class CheckingPolicy2 , class StoragePolicy2 >
GridType& schnek::Grid< T, rank, CheckingPolicy, StoragePolicy >::operator= ( const internal::GridBase< T2, rank, CheckingPolicy2, StoragePolicy2 > &  grid)
inline

assign another grid


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