CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
CNORXZ::PIndex< IndexT > Class Template Reference

#include <prange.h>

Inheritance diagram for CNORXZ::PIndex< IndexT >:
CNORXZ::IndexInterface< PIndex< IndexT >, IndexT::MetaType >

Public Types

typedef IndexInterface< PIndex< IndexT >, typename IndexT::MetaType > IB
 
typedef PRange< typename IndexT::RangeType > RangeType
 
typedef IndexT::MetaType MetaType
 

Public Member Functions

 PIndex (const RangePtr &range, SizeT pos=0)
 
PIndexoperator= (SizeT lexpos)
 
PIndexoperator++ ()
 
PIndexoperator-- ()
 
PIndex operator+ (Int n) const
 
PIndex operator- (Int n) const
 
SizeT operator- (const PIndex &i) const
 
PIndexoperator+= (Int n)
 
PIndexoperator-= (Int n)
 
SizeT lex () const
 
UPos pmax () const
 
UPos lmax () const
 
IndexId< 0 > id () const
 
decltype(autooperator* () const
 
SizeT dim () const
 
Sptr< RangeTyperange () const
 
template<SizeT I>
UPos stepSize (const IndexId< I > &id) const
 
String stringMeta () const
 
decltype(autometa () const
 
PIndexat (const MetaType &metaPos)
 
RangePtr prange (const PIndex< IndexT > &last) const
 
decltype(autodeepFormat () const
 
decltype(autodeepMax () const
 
PIndexreformat (const Vector< SizeT > &f, const Vector< SizeT > &s)
 
template<class Xpr , class F >
decltype(autoifor (const Xpr &xpr, F &&f) const
 
bool formatIsTrivial () const
 
decltype(autoxpr (const Sptr< PIndex< IndexT > > &_this) const
 
PIndexoperator() (const Sptr< IndexT > &i)
 
PIndexoperator() ()
 
const Sptr< IndexT > & orig () const
 
- Public Member Functions inherited from CNORXZ::IndexInterface< PIndex< IndexT >, IndexT::MetaType >
 ~IndexInterface ()=default
 
PIndex< IndexT > & THIS ()
 
const PIndex< IndexT > & THIS () const
 
PIndex< IndexT > & operator++ ()
 
PIndex< IndexT > & operator-- ()
 
PIndex< IndexT > operator+ (Int n) const
 
PIndex< IndexT > operator- (Int n) const
 
Int operator- (const IndexInterface &i) const
 
PIndex< IndexT > & operator+= (Int n)
 
PIndex< IndexT > & operator-= (Int n)
 
SizeT pos () const
 
SizeT lex () const
 
SizeT pmax () const
 
SizeT lmax () const
 
PtrId ptrId () const
 
decltype(auto) id () 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(auto) operator* () const
 
SizeT dim () const
 
decltype(auto) range () const
 
decltype(auto) stepSize (const IndexId< J > &id) const
 
String stringMeta () const
 
decltype(auto) meta () const
 
PIndex< IndexT > & at (const MetaType &meta)
 
RangePtr prange (const IndexInterface &end) const
 
decltype(auto) deepFormat () const
 
decltype(auto) deepMax () const
 
PIndex< IndexT > & reformat (const Vector< SizeT > &f, const Vector< SizeT > &s)
 
decltype(auto) ifor (const Xpr &xpr, F &&f) const
 
bool formatIsTrivial () const
 

Additional Inherited Members

- Protected Attributes inherited from CNORXZ::IndexInterface< PIndex< IndexT >, IndexT::MetaType >
SizeT mPos
 

Detailed Description

template<class IndexT>
class CNORXZ::PIndex< IndexT >

Index specific for PRange.

Template Parameters
IndexTFull index type.

Definition at line 27 of file prange.h.

Member Typedef Documentation

◆ IB

Definition at line 31 of file prange.h.

◆ MetaType

template<class IndexT >
typedef IndexT::MetaType CNORXZ::PIndex< IndexT >::MetaType

Definition at line 33 of file prange.h.

◆ RangeType

template<class IndexT >
typedef PRange<typename IndexT::RangeType> CNORXZ::PIndex< IndexT >::RangeType

Definition at line 32 of file prange.h.

Constructor & Destructor Documentation

◆ PIndex()

template<class IndexT >
CNORXZ::PIndex< IndexT >::PIndex ( const RangePtr & range,
SizeT pos = 0 )

Constructor.

Parameters
rangeRange to define index on.
posInitial lexicographic position (default = 0).

Definition at line 25 of file prange.cc.h.

Member Function Documentation

◆ at()

template<class IndexT >
PIndex< IndexT > & CNORXZ::PIndex< IndexT >::at ( const MetaType & metaPos)

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

Parameters
metameta data to be matched

Definition at line 198 of file prange.cc.h.

◆ deepFormat()

template<class IndexT >
decltype(auto) CNORXZ::PIndex< IndexT >::deepFormat ( ) const

recursive index format

Definition at line 164 of file prange.cc.h.

◆ deepMax()

template<class IndexT >
decltype(auto) CNORXZ::PIndex< IndexT >::deepMax ( ) const

max of all single-indices (recursive)

Definition at line 170 of file prange.cc.h.

◆ dim()

template<class IndexT >
SizeT CNORXZ::PIndex< IndexT >::dim ( ) const

index dimension

Definition at line 124 of file prange.cc.h.

◆ formatIsTrivial()

template<class IndexT >
bool CNORXZ::PIndex< IndexT >::formatIsTrivial ( ) const

check is format is trivial

Definition at line 220 of file prange.cc.h.

◆ id()

template<class IndexT >
IndexId< 0 > CNORXZ::PIndex< IndexT >::id ( ) const

index ID

Definition at line 112 of file prange.cc.h.

◆ ifor()

template<class IndexT >
template<class Xpr , class F >
decltype(auto) CNORXZ::PIndex< IndexT >::ifor ( const Xpr & xpr,
F && f ) const

create a for-loop expression

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

Definition at line 213 of file prange.cc.h.

◆ lex()

template<class IndexT >
SizeT CNORXZ::PIndex< IndexT >::lex ( ) const

lexicographic position

Definition at line 94 of file prange.cc.h.

◆ lmax()

template<class IndexT >
UPos CNORXZ::PIndex< IndexT >::lmax ( ) const

maximal lexicographic position

Definition at line 106 of file prange.cc.h.

◆ meta()

template<class IndexT >
decltype(auto) CNORXZ::PIndex< IndexT >::meta ( ) const

return meta data at current index position

Definition at line 192 of file prange.cc.h.

◆ operator()() [1/2]

Update current index position according to the internal index on the full range.

Definition at line 226 of file prange.cc.h.

◆ operator()() [2/2]

Replace instance of index on full range and update current position accordingly.

Parameters
iNew index instance.

Definition at line 233 of file prange.cc.h.

◆ operator*()

return meta data at current index position

Definition at line 118 of file prange.cc.h.

◆ operator+()

return index with lexicographic index position incremented n times

Parameters
n

Definition at line 60 of file prange.cc.h.

◆ operator++()

increment lexicographic index position

Definition at line 44 of file prange.cc.h.

◆ operator+=()

increment lexicographic index position n times

Parameters
n

Definition at line 78 of file prange.cc.h.

◆ operator-() [1/2]

Definition at line 66 of file prange.cc.h.

◆ operator-() [2/2]

return index with lexicographic index position decremented n times

Parameters
n

Definition at line 72 of file prange.cc.h.

◆ operator--()

decrement lexicographic index position

Definition at line 52 of file prange.cc.h.

◆ operator-=()

decrement lexicographic index position n times

Parameters
n

Definition at line 86 of file prange.cc.h.

◆ operator=()

Definition at line 36 of file prange.cc.h.

◆ orig()

template<class IndexT >
const Sptr< IndexT > & CNORXZ::PIndex< IndexT >::orig ( ) const

Get original index.

Returns
Index corresponding to original range and current position.

Definition at line 241 of file prange.cc.h.

◆ pmax()

template<class IndexT >
UPos CNORXZ::PIndex< IndexT >::pmax ( ) const

maximal memory position

Definition at line 100 of file prange.cc.h.

◆ prange()

template<class IndexT >
RangePtr CNORXZ::PIndex< IndexT >::prange ( const PIndex< IndexT > & last) const

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 148 of file prange.cc.h.

◆ range()

template<class IndexT >
Sptr< typename PIndex< IndexT >::RangeType > CNORXZ::PIndex< IndexT >::range ( ) const

pointer to the range the index is defined on

Definition at line 130 of file prange.cc.h.

◆ reformat()

template<class IndexT >
PIndex< IndexT > & CNORXZ::PIndex< IndexT >::reformat ( const Vector< SizeT > & f,
const Vector< SizeT > & s )

reformat index, create new index instance

Parameters
fnew format
snew sub-index sizes

Definition at line 176 of file prange.cc.h.

◆ stepSize()

template<class IndexT >
template<SizeT I>
UPos CNORXZ::PIndex< IndexT >::stepSize ( const IndexId< I > & id) const

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 137 of file prange.cc.h.

◆ stringMeta()

template<class IndexT >
String CNORXZ::PIndex< IndexT >::stringMeta ( ) const

return string formatted meta data at current index position

Definition at line 186 of file prange.cc.h.

◆ xpr()

template<class IndexT >
decltype(auto) CNORXZ::PIndex< IndexT >::xpr ( const Sptr< PIndex< IndexT > > & _this) const

Definition at line 206 of file prange.cc.h.


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