Schnek
schnek::SingleArrayGridFortranOrderStorageBase< T, rank, AllocationPolicy > Class Template Reference

Extends from SingleArrayGridStorageBase to provide Fortran-order indexing over the 1-dimensional data array for a multidimensional grid. More...

#include <single-array-storage-base.hpp>

Inheritance diagram for schnek::SingleArrayGridFortranOrderStorageBase< T, rank, AllocationPolicy >:
Collaboration diagram for schnek::SingleArrayGridFortranOrderStorageBase< T, rank, AllocationPolicy >:

Public Types

typedef SingleArrayGridStorageBase< T, rank, AllocationPolicy > BaseType
 Base class type.
 
typedef BaseType::IndexType IndexType
 The grid index type.
 
typedef BaseType::RangeType RangeType
 The grid index type.
 
- Public Types inherited from schnek::SingleArrayGridStorageBase< T, rank, AllocationPolicy >
typedef Array< int, rank > IndexType
 The grid index type.
 
typedef Range< int, rank > RangeType
 The grid range type.
 
typedef T * storage_iterator
 
typedef const T * const_storage_iterator
 

Public Member Functions

 SingleArrayGridFortranOrderStorageBase ()
 Default constructor.
 
 SingleArrayGridFortranOrderStorageBase (const SingleArrayGridFortranOrderStorageBase &)
 Copy constructor.
 
 SingleArrayGridFortranOrderStorageBase (const IndexType &lo, const IndexType &hi)
 Construct with a given size. More...
 
 SingleArrayGridFortranOrderStorageBase (const RangeType &range)
 Construct with a given size. More...
 
SingleArrayGridFortranOrderStorageBase< T, rank, AllocationPolicy > & operator= (const SingleArrayGridFortranOrderStorageBase< T, rank, AllocationPolicy > &)=default
 Assignment operator.
 
SCHNEK_INLINE T & get (const IndexType &index)
 Get the lvalue at a given grid index. More...
 
SCHNEK_INLINE const T & get (const IndexType &index) const
 Get the rvalue at a given grid index. More...
 
void resize (const IndexType &low, const IndexType &high)
 resizes to grid with lower indices low[0],...,low[rank-1] and upper indices high[0],...,high[rank-1]
 
void resize (const RangeType range)
 resizes to grid with the range. The endponts of the range are inclusive
 
ptrdiff_t stride (size_t dim) const
 returns the stride of the specified dimension
 
- Public Member Functions inherited from schnek::SingleArrayGridStorageBase< T, rank, AllocationPolicy >
 SingleArrayGridStorageBase ()
 Default constructor.
 
 SingleArrayGridStorageBase (const SingleArrayGridStorageBase &)=default
 Copy constructor.
 
SingleArrayGridStorageBase< T, rank, AllocationPolicy > & operator= (const SingleArrayGridStorageBase< T, rank, AllocationPolicy > &)=default
 Assignment operator.
 
T * getRawData () const
 Access to the underlying raw data.
 
SCHNEK_INLINE const IndexTypegetLo () const
 Get the lowest coordinate in the grid (inclusive)
 
SCHNEK_INLINE const IndexTypegetHi () const
 Get the highest coordinate in the grid (inclusive)
 
SCHNEK_INLINE const RangeTypegetRange () const
 Get the lowest coordinate in the grid (inclusive)
 
SCHNEK_INLINE const IndexTypegetDims () const
 Get the dimensions of the grid dims = high - low + 1
 
SCHNEK_INLINE int getLo (int k) const
 Get k-th component of the lowest coordinate in the grid (inclusive)
 
SCHNEK_INLINE int getHi (int k) const
 Get k-th component of the highest coordinate in the grid (inclusive)
 
SCHNEK_INLINE int getDims (int k) const
 Get k-th component of the dimensions of the grid dims = high - low + 1
 
SCHNEK_INLINE int getSize () const
 Get the length of the allocated array.
 
SCHNEK_INLINE storage_iterator begin ()
 
SCHNEK_INLINE storage_iterator end ()
 
SCHNEK_INLINE const_storage_iterator cbegin () const
 
SCHNEK_INLINE const_storage_iterator cend () const
 

Detailed Description

template<typename T, size_t rank, template< typename, size_t > class AllocationPolicy>
class schnek::SingleArrayGridFortranOrderStorageBase< T, rank, AllocationPolicy >

Extends from SingleArrayGridStorageBase to provide Fortran-order indexing over the 1-dimensional data array for a multidimensional grid.

Template Parameters
TThe type of data stored in the grid
rankThe rank of the grid
AllocationPolicyThe allocation policy

Constructor & Destructor Documentation

◆ SingleArrayGridFortranOrderStorageBase() [1/2]

template<typename T , size_t rank, template< typename, size_t > class AllocationPolicy>
schnek::SingleArrayGridFortranOrderStorageBase< T, rank, AllocationPolicy >::SingleArrayGridFortranOrderStorageBase ( const IndexType lo,
const IndexType hi 
)

Construct with a given size.

Parameters
lothe lowest coordinate in the grid (inclusive)
lothe highest coordinate in the grid (inclusive)

◆ SingleArrayGridFortranOrderStorageBase() [2/2]

template<typename T , size_t rank, template< typename, size_t > class AllocationPolicy>
schnek::SingleArrayGridFortranOrderStorageBase< T, rank, AllocationPolicy >::SingleArrayGridFortranOrderStorageBase ( const RangeType range)

Construct with a given size.

Parameters
rangethe lowest and highest coordinates in the grid (inclusive)

Member Function Documentation

◆ get() [1/2]

template<typename T , size_t rank, template< typename, size_t > class AllocationPolicy>
SCHNEK_INLINE T & schnek::SingleArrayGridFortranOrderStorageBase< T, rank, AllocationPolicy >::get ( const IndexType index)

Get the lvalue at a given grid index.

Parameters
indexThe grid index
Returns
the lvalue at the grid index

◆ get() [2/2]

template<typename T , size_t rank, template< typename, size_t > class AllocationPolicy>
SCHNEK_INLINE const T & schnek::SingleArrayGridFortranOrderStorageBase< T, rank, AllocationPolicy >::get ( const IndexType index) const

Get the rvalue at a given grid index.

Parameters
indexThe grid index
Returns
the rvalue at the grid index

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