CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
CNORXZ::IndexInterface< I, MetaType > Class Template Reference

#include <index_base.h>

Public Member Functions

 ~IndexInterface ()=default
 
I & THIS ()
 
const I & THIS () const
 
I & operator++ ()
 
I & operator-- ()
 
operator+ (Int n) const
 
operator- (Int n) const
 
I & operator+= (Int n)
 
I & operator-= (Int n)
 
Int operator- (const IndexInterface &i) const
 
SizeT pos () const
 
SizeT lex () const
 
SizeT pmax () const
 
SizeT lmax () const
 
PtrId ptrId () const
 
decltype(autoid () const
 
bool operator== (const IndexInterface &i) const
 
bool operator!= (const IndexInterface &i) const
 
bool operator< (const IndexInterface &i) const
 
bool operator> (const IndexInterface &i) const
 
bool operator<= (const IndexInterface &i) const
 
bool operator>= (const IndexInterface &i) const
 
decltype(autooperator* () const
 
SizeT dim () const
 
decltype(autorange () const
 
template<SizeT J>
decltype(autostepSize (const IndexId< J > &id) const
 
String stringMeta () const
 
decltype(autometa () const
 
I & at (const MetaType &meta)
 
RangePtr prange (const IndexInterface &end) const
 
decltype(autodeepFormat () const
 
decltype(autodeepMax () const
 
I & reformat (const Vector< SizeT > &f, const Vector< SizeT > &s)
 
template<class Xpr , class F = NoF>
decltype(autoifor (const Xpr &xpr, F &&f) const
 
bool formatIsTrivial () const
 

Protected Attributes

SizeT mPos = 0
 

Detailed Description

template<class I, typename MetaType>
class CNORXZ::IndexInterface< I, MetaType >

Basic index interface class template

Static polymorphism: This class defines an interface template; all indices are supposed to be derived from the corresponding template instance

Indices act as iterators over parameter spaces (ranges) and/or the containers (arrays) defined on them

Moreover, indices are used to define operations on the corresponding parameters space

In principle, one distinguishes between lexicographic position (= index position) and the memory position of the corresponding meta data w.r.t. the first element

Template Parameters
IIndex type, recurring template argument
MetaTypedata type of the meta data
See also
RangeBase
RangeInterface

Definition at line 47 of file index_base.h.

Constructor & Destructor Documentation

◆ ~IndexInterface()

template<class I , typename MetaType >
CNORXZ::IndexInterface< I, MetaType >::~IndexInterface ( )
default

default destructor

Member Function Documentation

◆ at()

template<class I , typename MetaType >
I & CNORXZ::IndexInterface< I, MetaType >::at ( const MetaType & meta)
inline

set index position so that it's meta data matches input

Parameters
metameta data to be matched

Definition at line 164 of file index_base.h.

◆ deepFormat()

template<class I , typename MetaType >
decltype(auto) CNORXZ::IndexInterface< I, MetaType >::deepFormat ( ) const
inline

recursive index format

Definition at line 173 of file index_base.h.

◆ deepMax()

template<class I , typename MetaType >
decltype(auto) CNORXZ::IndexInterface< I, MetaType >::deepMax ( ) const
inline

max of all single-indices (recursive)

Definition at line 176 of file index_base.h.

◆ dim()

template<class I , typename MetaType >
SizeT CNORXZ::IndexInterface< I, MetaType >::dim ( ) const
inline

index dimension

Definition at line 141 of file index_base.h.

◆ formatIsTrivial()

template<class I , typename MetaType >
bool CNORXZ::IndexInterface< I, MetaType >::formatIsTrivial ( ) const
inline

check is format is trivial

Definition at line 196 of file index_base.h.

◆ id()

template<class I , typename MetaType >
decltype(auto) CNORXZ::IndexInterface< I, MetaType >::id ( ) const
inline

index ID

Definition at line 105 of file index_base.h.

◆ ifor()

template<class I , typename MetaType >
template<class Xpr , class F = NoF>
decltype(auto) CNORXZ::IndexInterface< I, MetaType >::ifor ( const Xpr & xpr,
F && f ) const
inline

create a for-loop expression

Template Parameters
Xprloop internal expression
Faccumulating function
Parameters
xprloop internal expression
faccumulating function

Definition at line 192 of file index_base.h.

◆ lex()

template<class I , typename MetaType >
SizeT CNORXZ::IndexInterface< I, MetaType >::lex ( ) const
inline

lexicographic position

Definition at line 94 of file index_base.h.

◆ lmax()

template<class I , typename MetaType >
SizeT CNORXZ::IndexInterface< I, MetaType >::lmax ( ) const
inline

maximal lexicographic position

Definition at line 100 of file index_base.h.

◆ meta()

template<class I , typename MetaType >
decltype(auto) CNORXZ::IndexInterface< I, MetaType >::meta ( ) const
inline

return meta data at current index position

Definition at line 158 of file index_base.h.

◆ operator!=()

template<class I , typename MetaType >
bool CNORXZ::IndexInterface< I, MetaType >::operator!= ( const IndexInterface< I, MetaType > & i) const

check if indices are not equal

Parameters
iIndex to compare with

Definition at line 71 of file index_base.cc.h.

◆ operator*()

template<class I , typename MetaType >
decltype(auto) CNORXZ::IndexInterface< I, MetaType >::operator* ( ) const
inline

return meta data at current index position

Definition at line 138 of file index_base.h.

◆ operator+()

template<class I , typename MetaType >
I CNORXZ::IndexInterface< I, MetaType >::operator+ ( Int n) const
inline

return index with lexicographic index position incremented n times

Parameters
n

Definition at line 68 of file index_base.h.

◆ operator++()

template<class I , typename MetaType >
I & CNORXZ::IndexInterface< I, MetaType >::operator++ ( )
inline

increment lexicographic index position

Definition at line 60 of file index_base.h.

◆ operator+=()

template<class I , typename MetaType >
I & CNORXZ::IndexInterface< I, MetaType >::operator+= ( Int n)
inline

increment lexicographic index position n times

Parameters
n

Definition at line 78 of file index_base.h.

◆ operator-() [1/2]

template<class I , typename MetaType >
Int CNORXZ::IndexInterface< I, MetaType >::operator- ( const IndexInterface< I, MetaType > & i) const
inline

difference of lexicographic index postions

Parameters
iIndex to compare with

Definition at line 88 of file index_base.h.

◆ operator-() [2/2]

template<class I , typename MetaType >
I CNORXZ::IndexInterface< I, MetaType >::operator- ( Int n) const
inline

return index with lexicographic index position decremented n times

Parameters
n

Definition at line 73 of file index_base.h.

◆ operator--()

template<class I , typename MetaType >
I & CNORXZ::IndexInterface< I, MetaType >::operator-- ( )
inline

decrement lexicographic index position

Definition at line 63 of file index_base.h.

◆ operator-=()

template<class I , typename MetaType >
I & CNORXZ::IndexInterface< I, MetaType >::operator-= ( Int n)
inline

decrement lexicographic index position n times

Parameters
n

Definition at line 83 of file index_base.h.

◆ operator<()

template<class I , typename MetaType >
bool CNORXZ::IndexInterface< I, MetaType >::operator< ( const IndexInterface< I, MetaType > & i) const

check if index position is less than that of i

Parameters
iIndex to compare with

Definition at line 77 of file index_base.cc.h.

◆ operator<=()

template<class I , typename MetaType >
bool CNORXZ::IndexInterface< I, MetaType >::operator<= ( const IndexInterface< I, MetaType > & i) const

check if index position is less or equal than that of i

Parameters
iIndex to compare with

Definition at line 89 of file index_base.cc.h.

◆ operator==()

template<class I , typename MetaType >
bool CNORXZ::IndexInterface< I, MetaType >::operator== ( const IndexInterface< I, MetaType > & i) const

check if indices are equal

Parameters
iIndex to compare with

Definition at line 65 of file index_base.cc.h.

◆ operator>()

template<class I , typename MetaType >
bool CNORXZ::IndexInterface< I, MetaType >::operator> ( const IndexInterface< I, MetaType > & i) const

check if index position is greater than that of i

Parameters
iIndex to compare with

Definition at line 83 of file index_base.cc.h.

◆ operator>=()

template<class I , typename MetaType >
bool CNORXZ::IndexInterface< I, MetaType >::operator>= ( const IndexInterface< I, MetaType > & i) const

check if index position is greater or equal than that of i

Parameters
iIndex to compare with

Definition at line 95 of file index_base.cc.h.

◆ pmax()

template<class I , typename MetaType >
SizeT CNORXZ::IndexInterface< I, MetaType >::pmax ( ) const
inline

maximal memory position

Definition at line 97 of file index_base.h.

◆ pos()

template<class I , typename MetaType >
SizeT CNORXZ::IndexInterface< I, MetaType >::pos ( ) const

memory position

Definition at line 101 of file index_base.cc.h.

◆ prange()

template<class I , typename MetaType >
RangePtr CNORXZ::IndexInterface< I, MetaType >::prange ( const IndexInterface< I, MetaType > & end) const
inline

create partial range starting at this index' position and ending at the position of input index. The end position is included!

Parameters
endend index

Definition at line 170 of file index_base.h.

◆ ptrId()

template<class I , typename MetaType >
PtrId CNORXZ::IndexInterface< I, MetaType >::ptrId ( ) const

Definition at line 107 of file index_base.cc.h.

◆ range()

template<class I , typename MetaType >
decltype(auto) CNORXZ::IndexInterface< I, MetaType >::range ( ) const
inline

pointer to the range the index is defined on

Definition at line 144 of file index_base.h.

◆ reformat()

template<class I , typename MetaType >
I & CNORXZ::IndexInterface< I, MetaType >::reformat ( const Vector< SizeT > & f,
const Vector< SizeT > & s )
inline

reformat index, create new index instance

Parameters
fnew format
snew sub-index sizes

Definition at line 182 of file index_base.h.

◆ stepSize()

template<class I , typename MetaType >
template<SizeT J>
decltype(auto) CNORXZ::IndexInterface< I, MetaType >::stepSize ( const IndexId< J > & id) const
inline

return the memory step size this index has w.r.t. to index of given ID

Template Parameters
Jstatic index ID, size type
Parameters
idinput index ID

Definition at line 152 of file index_base.h.

◆ stringMeta()

template<class I , typename MetaType >
String CNORXZ::IndexInterface< I, MetaType >::stringMeta ( ) const
inline

return string formatted meta data at current index position

Definition at line 155 of file index_base.h.

◆ THIS() [1/2]

template<class I , typename MetaType >
I & CNORXZ::IndexInterface< I, MetaType >::THIS ( )
inline

explicit static cast

Definition at line 54 of file index_base.h.

◆ THIS() [2/2]

template<class I , typename MetaType >
const I & CNORXZ::IndexInterface< I, MetaType >::THIS ( ) const
inline

explicit static cast (const)

Definition at line 57 of file index_base.h.

Member Data Documentation

◆ mPos

template<class I , typename MetaType >
SizeT CNORXZ::IndexInterface< I, MetaType >::mPos = 0
protected

the memory position

Definition at line 199 of file index_base.h.


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