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

#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 GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > BaseType
 
- Public Types inherited from schnek::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 GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > GridBaseType
 

Public Member Functions

 Grid ()
 
 Grid (const IndexType &size)
 
 Grid (const IndexType &low, const IndexType &high)
 
 Grid (const RangeType &range)
 
 Grid (const Grid< T, rank, CheckingPolicy, StoragePolicy > &)
 
GridTypeoperator= (const T &val)
 
GridTypeoperator= (const GridType &grid)
 
template<typename T2 , class CheckingPolicy2 , class StoragePolicy2 >
GridTypeoperator= (const GridBase< T2, rank, CheckingPolicy2, StoragePolicy2 > &grid)
 
- Public Member Functions inherited from schnek::GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > >
 GridBase (const Array< int, rank, ArrayCheckingPolicy > &size)
 
 GridBase (const Array< int, rank, ArrayCheckingPolicy > &low, const Array< int, rank, ArrayCheckingPolicy > &high)
 
T & operator[] (const Array< int, rank, ArrayCheckingPolicy > &pos)
 
operator[] (const Array< int, rank, ArrayCheckingPolicy > &pos) const
 
T & operator[] (const ArrayExpression< Operator, Length > &pos)
 
operator[] (const ArrayExpression< Operator, Length > &pos) const
 
T & operator[] (int i)
 
operator[] (int i) const
 
T & operator() (int i)
 
operator() (int i) const
 
T & operator() (int i, int j)
 
operator() (int i, int j) const
 
T & operator() (int i, int j, int k)
 
operator() (int i, int j, int k) const
 
T & operator() (int i, int j, int k, int l)
 
operator() (int i, int j, int k, int l) const
 
T & operator() (int i, int j, int k, int l, int m)
 
operator() (int i, int j, int k, int l, int m) const
 
T & operator() (int i, int j, int k, int l, int m, int o)
 
operator() (int i, int j, int k, int l, int m, int o) const
 
T & operator() (int i, int j, int k, int l, int m, int o, int p)
 
operator() (int i, int j, int k, int l, int m, int o, int p) const
 
T & operator() (int i, int j, int k, int l, int m, int o, int p, int q)
 
operator() (int i, int j, int k, int l, int m, int o, int p, int q) const
 
T & operator() (int i, int j, int k, int l, int m, int o, int p, int q, int r)
 
operator() (int i, int j, int k, int l, int m, int o, int p, int q, int r) const
 
T & operator() (int i, int j, int k, int l, int m, int o, int p, int q, int r, int s)
 
operator() (int i, int j, int k, int l, int m, int o, int p, int q, int r, int s) const
 
GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > & operator= (const GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > &)
 
GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > & operator= (const GridBase< T2, rank, CheckingPolicy2, StoragePolicy2 > &)
 
GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > & operator= (const T &val)
 
GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > & operator-= (GridBase< T2, rank, CheckingPolicy2, StoragePolicy< T, rank > > &)
 
GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > & operator-= (GridBase< T2, rank, CheckingPolicy2, StoragePolicy2 > &)
 
GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > & operator+= (GridBase< T2, rank, CheckingPolicy2, StoragePolicy< T, rank > > &)
 
GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > > & operator+= (GridBase< T2, rank, CheckingPolicy2, StoragePolicy2 > &)
 
void resize (const IndexType &size)
 
void resize (const IndexType &low, const IndexType &high)
 
void resize (const GridBase< T2, rank, CheckingPolicy2, StoragePolicy2 > &grid)
 

Additional Inherited Members

- Protected Member Functions inherited from schnek::GridBase< T, rank, CheckingPolicy< rank >, StoragePolicy< T, rank > >
void copyFromGrid (const GridBase< T2, rank, CheckingPolicy2, StoragePolicy< T, rank > > &grid)
 

Detailed Description

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

An elementary grid class

The reason we inherit from GridBase, is for ease of specifying template arguments.

Constructor & Destructor Documentation

◆ Grid() [1/5]

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

default constructor creates an empty grid

◆ Grid() [2/5]

template<typename T, int rank, template< int > class CheckingPolicy = GridNoArgCheck, template< typename, int > 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() [3/5]

template<typename T, int rank, template< int > class CheckingPolicy = GridNoArgCheck, template< typename, int > 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() [4/5]

template<typename T, int rank, template< int > class CheckingPolicy = GridNoArgCheck, template< typename, int > 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]

◆ Grid() [5/5]

template<typename T, int rank, template< int > class CheckingPolicy = GridNoArgCheck, template< typename, int > class StoragePolicy = SingleArrayGridStorage>
schnek::Grid< T, rank, CheckingPolicy, StoragePolicy >::Grid ( const Grid< T, rank, CheckingPolicy, StoragePolicy > &  )

copy constructor

Member Function Documentation

◆ operator=() [1/3]

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

assign another grid

◆ operator=() [2/3]

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

assign another grid

◆ operator=() [3/3]

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

assign another grid


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