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

#include <dindex.h>

Inheritance diagram for CNORXZ::DIndex:
CNORXZ::IndexInterface< DIndex, DType >

Public Types

typedef IndexInterface< DIndex, DTypeIB
 
typedef DType MetaType
 
typedef RangeBase RangeType
 

Public Member Functions

 DEFAULT_C (DIndex)
 
 DIndex (const DIndex &i)
 
 DIndex (DIndex &&i)
 
DIndexoperator= (const DIndex &i)
 
DIndexoperator= (DIndex &&i)
 
 DIndex (const XIndexPtr &i)
 
 DIndex (const RangePtr &r, SizeT lexpos=0)
 
template<class Index , typename Meta >
 DIndex (const IndexInterface< Index, Meta > &i)
 
DIndexoperator= (SizeT lexpos)
 
DIndexoperator++ ()
 
DIndexoperator-- ()
 
DIndex operator+ (Int n) const
 
DIndex operator- (Int n) const
 
SizeT operator- (const DIndex &i) const
 
DIndexoperator+= (Int n)
 
DIndexoperator-= (Int n)
 
SizeT lex () const
 
UPos pmax () const
 
UPos lmax () const
 
IndexId< 0 > id () const
 
DType operator* () const
 
SizeT dim () const
 
RangePtr range () const
 
UPos stepSize (const IndexId< 0 > &id) const
 
String stringMeta () const
 
DType meta () const
 
DIndexat (const DType &meta)
 
RangePtr prange (const DIndex &end) const
 
Vector< SizeTdeepFormat () const
 
Vector< SizeTdeepMax () const
 
DIndexreformat (const Vector< SizeT > &f, const Vector< SizeT > &s)
 
template<class Xpr , class F >
decltype(autoifor (const Xpr &xpr, F &&f) const
 
bool formatIsTrivial () const
 
const XIndexPtrxptr () const
 
- Public Member Functions inherited from CNORXZ::IndexInterface< DIndex, DType >
 ~IndexInterface ()=default
 
DIndexTHIS ()
 
const DIndexTHIS () const
 
DIndexoperator++ ()
 
DIndexoperator-- ()
 
DIndex operator+ (Int n) const
 
DIndex operator- (Int n) const
 
Int operator- (const IndexInterface &i) const
 
DIndexoperator+= (Int n)
 
DIndexoperator-= (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
 
DIndexat (const DType &meta)
 
RangePtr prange (const IndexInterface &end) const
 
decltype(auto) deepFormat () const
 
decltype(auto) deepMax () const
 
DIndexreformat (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< DIndex, DType >
SizeT mPos
 

Detailed Description


index of compile-time-unspecified type

Definition at line 25 of file dindex.h.

Member Typedef Documentation

◆ IB

Definition at line 28 of file dindex.h.

◆ MetaType

Definition at line 29 of file dindex.h.

◆ RangeType

Definition at line 30 of file dindex.h.

Constructor & Destructor Documentation

◆ DIndex() [1/5]

CNORXZ::DIndex::DIndex ( const DIndex & i)

copy constructor

Parameters
iindex to copy

Definition at line 16 of file dindex.cc.

◆ DIndex() [2/5]

CNORXZ::DIndex::DIndex ( DIndex && i)

move constructor

Parameters
iindex to move

Definition at line 21 of file dindex.cc.

◆ DIndex() [3/5]

CNORXZ::DIndex::DIndex ( const XIndexPtr & i)

construct from XIndex instance

Parameters
iXIndex to use for construction

Definition at line 45 of file dindex.cc.

◆ DIndex() [4/5]

CNORXZ::DIndex::DIndex ( const RangePtr & r,
SizeT lexpos = 0 )

construct from range pointer

Parameters
rRange to iterate over
lexposinitial lexicographic position

Definition at line 50 of file dindex.cc.

◆ DIndex() [5/5]

template<class Index , typename Meta >
CNORXZ::DIndex::DIndex ( const IndexInterface< Index, Meta > & i)

construct from index of arbitrary type

Parameters
iIndex to use for construction

Definition at line 20 of file dindex.cc.h.

Member Function Documentation

◆ at()

DIndex & CNORXZ::DIndex::at ( const DType & meta)

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

Parameters
metameta data to be matched

Definition at line 173 of file dindex.cc.

◆ deepFormat()

Vector< SizeT > CNORXZ::DIndex::deepFormat ( ) const

recursive index format

Definition at line 185 of file dindex.cc.

◆ deepMax()

Vector< SizeT > CNORXZ::DIndex::deepMax ( ) const

max of all single-indices (recursive)

Definition at line 190 of file dindex.cc.

◆ DEFAULT_C()

CNORXZ::DIndex::DEFAULT_C ( DIndex )

default constructor

◆ dim()

SizeT CNORXZ::DIndex::dim ( ) const

index dimension

Definition at line 132 of file dindex.cc.

◆ formatIsTrivial()

bool CNORXZ::DIndex::formatIsTrivial ( ) const

check is format is trivial

Definition at line 201 of file dindex.cc.

◆ id()

IndexId< 0 > CNORXZ::DIndex::id ( ) const

index ID

Definition at line 122 of file dindex.cc.

◆ ifor()

template<class Xpr , class F >
decltype(auto) CNORXZ::DIndex::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 26 of file dindex.cc.h.

◆ lex()

SizeT CNORXZ::DIndex::lex ( ) const

lexicographic position

Definition at line 107 of file dindex.cc.

◆ lmax()

UPos CNORXZ::DIndex::lmax ( ) const

maximal lexicographic position

Definition at line 117 of file dindex.cc.

◆ meta()

DType CNORXZ::DIndex::meta ( ) const

return meta data at current index position

Definition at line 168 of file dindex.cc.

◆ operator*()

DType CNORXZ::DIndex::operator* ( ) const

return meta data at current index position

Definition at line 127 of file dindex.cc.

◆ operator+()

DIndex CNORXZ::DIndex::operator+ ( Int n) const

return index with lexicographic index position incremented n times

Parameters
n

Definition at line 78 of file dindex.cc.

◆ operator++()

DIndex & CNORXZ::DIndex::operator++ ( )

increment lexicographic index position

Definition at line 64 of file dindex.cc.

◆ operator+=()

DIndex & CNORXZ::DIndex::operator+= ( Int n)

increment lexicographic index position n times

Parameters
n

Definition at line 93 of file dindex.cc.

◆ operator-() [1/2]

SizeT CNORXZ::DIndex::operator- ( const DIndex & i) const

Definition at line 88 of file dindex.cc.

◆ operator-() [2/2]

DIndex CNORXZ::DIndex::operator- ( Int n) const

return index with lexicographic index position decremented n times

Parameters
n

Definition at line 83 of file dindex.cc.

◆ operator--()

DIndex & CNORXZ::DIndex::operator-- ( )

decrement lexicographic index position

Definition at line 71 of file dindex.cc.

◆ operator-=()

DIndex & CNORXZ::DIndex::operator-= ( Int n)

decrement lexicographic index position n times

Parameters
n

Definition at line 100 of file dindex.cc.

◆ operator=() [1/3]

DIndex & CNORXZ::DIndex::operator= ( const DIndex & i)

copy assignment

Parameters
iindex to copy

Definition at line 28 of file dindex.cc.

◆ operator=() [2/3]

DIndex & CNORXZ::DIndex::operator= ( DIndex && i)

move assignment

Parameters
iindex to move

Definition at line 36 of file dindex.cc.

◆ operator=() [3/3]

DIndex & CNORXZ::DIndex::operator= ( SizeT lexpos)

Definition at line 57 of file dindex.cc.

◆ pmax()

UPos CNORXZ::DIndex::pmax ( ) const

maximal memory position

Definition at line 112 of file dindex.cc.

◆ prange()

RangePtr CNORXZ::DIndex::prange ( const DIndex & end) 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 180 of file dindex.cc.

◆ range()

RangePtr CNORXZ::DIndex::range ( ) const

pointer to the range the index is defined on

Definition at line 137 of file dindex.cc.

◆ reformat()

DIndex & CNORXZ::DIndex::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 195 of file dindex.cc.

◆ stepSize()

UPos CNORXZ::DIndex::stepSize ( const IndexId< 0 > & 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 142 of file dindex.cc.

◆ stringMeta()

String CNORXZ::DIndex::stringMeta ( ) const

return string formatted meta data at current index position

Definition at line 163 of file dindex.cc.

◆ xptr()

const XIndexPtr & CNORXZ::DIndex::xptr ( ) const

get internal XIndex instance

Returns
shared pointer to XIndex instance

Definition at line 206 of file dindex.cc.


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