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

#include <yrange.h>

Inheritance diagram for CNORXZ::YIndex:
CNORXZ::IndexInterface< YIndex, Vector< DType > > CNORXZ::AIndex< T > CNORXZ::BIndex< T >

Public Types

typedef IndexInterface< YIndex, Vector< DType > > IB
 
typedef YRange RangeType
 
typedef Vector< DTypeMetaType
 

Public Member Functions

 INDEX_RANDOM_ACCESS_ITERATOR_DEFS (MetaType)
 
 YIndex ()=default
 
 YIndex (YIndex &&i)=default
 
YIndexoperator= (YIndex &&i)=default
 
 YIndex (const YIndex &i)
 
YIndexoperator= (const YIndex &i)
 
 YIndex (const Vector< XIndexPtr > &is)
 
 YIndex (const YFormat &bs, const Vector< XIndexPtr > &is)
 
 YIndex (const RangePtr &range, SizeT lexpos=0)
 
 YIndex (const RangePtr &range, const YFormat &bs, SizeT lexpos=0)
 
YIndexoperator= (SizeT lexpos)
 
YIndexoperator++ ()
 
YIndexoperator-- ()
 
YIndex operator+ (Int n) const
 
YIndex operator- (Int n) const
 
SizeT operator- (const YIndex &i) const
 
YIndexoperator+= (Int n)
 
YIndexoperator-= (Int n)
 
SizeT lex () const
 
UPos pmax () const
 
UPos lmax () const
 
IndexId< 0 > id () const
 
Vector< DTypeoperator* () const
 
SizeT dim () const
 
Sptr< YRangerange () const
 
UPos stepSize (const IndexId< 0 > id) const
 
String stringMeta () const
 
Vector< DTypemeta () const
 
YIndexat (const Vector< DType > &meta)
 
RangePtr prange (const YIndex &last) const
 
Vector< SizeTdeepFormat () const
 
Vector< SizeTdeepMax () const
 
YIndexreformat (const Vector< SizeT > &f, const Vector< SizeT > &s)
 
DXpr< Noneifor (const DXpr< None > &xpr, NoF &&f) const
 
bool formatIsTrivial () const
 
YIndexoperator() (const Sptr< YIndex > &i)
 
YIndexoperator() ()
 
const DPackpack () const
 
const YFormatformat () const
 
const YFormatlexFormat () const
 
YIndexsetFormat (const YFormat &bs)
 
YIndexsetSub (SizeT ind, SizeT lex)
 
- Public Member Functions inherited from CNORXZ::IndexInterface< YIndex, Vector< DType > >
 ~IndexInterface ()=default
 
YIndexTHIS ()
 
const YIndexTHIS () const
 
YIndexoperator++ ()
 
YIndexoperator-- ()
 
YIndex operator+ (Int n) const
 
YIndex operator- (Int n) const
 
Int operator- (const IndexInterface &i) const
 
YIndexoperator+= (Int n)
 
YIndexoperator-= (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
 
YIndexat (const Vector< DType > &meta)
 
RangePtr prange (const IndexInterface &end) const
 
decltype(auto) deepFormat () const
 
decltype(auto) deepMax () const
 
YIndexreformat (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< YIndex, Vector< DType > >
SizeT mPos
 

Detailed Description


Specific index for YRanges.

A YIndex is a multi-index which consists of a set of sub-indices and a format. In the case the index is used to access data, this format determines the linearized memory position for a given sub-index combination.

Definition at line 33 of file yrange.h.

Member Typedef Documentation

◆ IB

Definition at line 36 of file yrange.h.

◆ MetaType

Definition at line 38 of file yrange.h.

◆ RangeType

Definition at line 37 of file yrange.h.

Constructor & Destructor Documentation

◆ YIndex() [1/7]

CNORXZ::YIndex::YIndex ( )
default

Default constructor.

◆ YIndex() [2/7]

CNORXZ::YIndex::YIndex ( YIndex && i)
default

Move constructor.

◆ YIndex() [3/7]

CNORXZ::YIndex::YIndex ( const YIndex & i)

Copy constructor. No default copy: Have to copy sub-index instances

Definition at line 137 of file yrange.cc.

◆ YIndex() [4/7]

CNORXZ::YIndex::YIndex ( const Vector< XIndexPtr > & is)

Construct from sub-index pointers.

Parameters
isVector of XIndex pointers.

Definition at line 161 of file yrange.cc.

◆ YIndex() [5/7]

CNORXZ::YIndex::YIndex ( const YFormat & bs,
const Vector< XIndexPtr > & is )

Construct from sub-index pointers, specify index format.

Parameters
bsIndex format (YFormat).
isVector of XIndex pointers.

Definition at line 173 of file yrange.cc.

◆ YIndex() [6/7]

CNORXZ::YIndex::YIndex ( const RangePtr & range,
SizeT lexpos = 0 )

Construct from a range and an initial lexicographic position

Parameters
rangeRange to iterate over.
lexposInitial lexicographic position.

Definition at line 185 of file yrange.cc.

◆ YIndex() [7/7]

CNORXZ::YIndex::YIndex ( const RangePtr & range,
const YFormat & bs,
SizeT lexpos = 0 )

Construct from a range and an initial lexicographic position, specify format.

Parameters
rangeRange to iterate over.
bsIndex format.
lexposInitial lexicographic position.

Definition at line 197 of file yrange.cc.

Member Function Documentation

◆ at()

YIndex & CNORXZ::YIndex::at ( const Vector< DType > & meta)

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

Parameters
metameta data to be matched

Definition at line 345 of file yrange.cc.

◆ deepFormat()

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

recursive index format

Definition at line 391 of file yrange.cc.

◆ deepMax()

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

max of all single-indices (recursive)

Definition at line 410 of file yrange.cc.

◆ dim()

SizeT CNORXZ::YIndex::dim ( ) const

index dimension

Definition at line 305 of file yrange.cc.

◆ format()

const YFormat & CNORXZ::YIndex::format ( ) const

Get index format.

Returns
The format.

Definition at line 491 of file yrange.cc.

◆ formatIsTrivial()

bool CNORXZ::YIndex::formatIsTrivial ( ) const

check is format is trivial

Definition at line 473 of file yrange.cc.

◆ id()

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

index ID

Definition at line 295 of file yrange.cc.

◆ ifor()

DXpr< None > CNORXZ::YIndex::ifor ( const DXpr< None > & xpr,
NoF && f ) const

create a for-loop expression

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

Definition at line 357 of file yrange.cc.

◆ INDEX_RANDOM_ACCESS_ITERATOR_DEFS()

CNORXZ::YIndex::INDEX_RANDOM_ACCESS_ITERATOR_DEFS ( MetaType )

◆ lex()

SizeT CNORXZ::YIndex::lex ( ) const

lexicographic position

Definition at line 280 of file yrange.cc.

◆ lexFormat()

const YFormat & CNORXZ::YIndex::lexFormat ( ) const

Get lexicographic (trivial) index format.

Returns
The lexicographic format.

Definition at line 496 of file yrange.cc.

◆ lmax()

UPos CNORXZ::YIndex::lmax ( ) const

maximal lexicographic position

Definition at line 290 of file yrange.cc.

◆ meta()

Vector< DType > CNORXZ::YIndex::meta ( ) const

return meta data at current index position

Definition at line 337 of file yrange.cc.

◆ operator()() [1/2]

YIndex & CNORXZ::YIndex::operator() ( )

Update all linearized positions.

Definition at line 369 of file yrange.cc.

◆ operator()() [2/2]

YIndex & CNORXZ::YIndex::operator() ( const Sptr< YIndex > & i)

Replace sub-index instances. All linearized positions are updated accordingly.

Parameters
iPointer to YIndex which provides the new sub-index instance

Definition at line 362 of file yrange.cc.

◆ operator*()

Vector< DType > CNORXZ::YIndex::operator* ( ) const

return meta data at current index position

Definition at line 300 of file yrange.cc.

◆ operator+()

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

return index with lexicographic index position incremented n times

Parameters
n

Definition at line 247 of file yrange.cc.

◆ operator++()

YIndex & CNORXZ::YIndex::operator++ ( )

increment lexicographic index position

Definition at line 225 of file yrange.cc.

◆ operator+=()

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

increment lexicographic index position n times

Parameters
n

Definition at line 264 of file yrange.cc.

◆ operator-() [1/2]

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

Definition at line 259 of file yrange.cc.

◆ operator-() [2/2]

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

return index with lexicographic index position decremented n times

Parameters
n

Definition at line 253 of file yrange.cc.

◆ operator--()

YIndex & CNORXZ::YIndex::operator-- ( )

decrement lexicographic index position

Definition at line 236 of file yrange.cc.

◆ operator-=()

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

decrement lexicographic index position n times

Parameters
n

Definition at line 272 of file yrange.cc.

◆ operator=() [1/3]

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

Copy assigment. No default copy: Have to copy sub-index instances

Definition at line 149 of file yrange.cc.

◆ operator=() [2/3]

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

Definition at line 209 of file yrange.cc.

◆ operator=() [3/3]

YIndex & CNORXZ::YIndex::operator= ( YIndex && i)
default

Move assignment.

◆ pack()

const DPack & CNORXZ::YIndex::pack ( ) const

Get all sub-indices

Returns
Pack of sub-indices

Definition at line 375 of file yrange.cc.

◆ pmax()

UPos CNORXZ::YIndex::pmax ( ) const

maximal memory position

Definition at line 285 of file yrange.cc.

◆ prange()

RangePtr CNORXZ::YIndex::prange ( const YIndex & 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 380 of file yrange.cc.

◆ range()

Sptr< YRange > CNORXZ::YIndex::range ( ) const

pointer to the range the index is defined on

Definition at line 310 of file yrange.cc.

◆ reformat()

YIndex & CNORXZ::YIndex::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 427 of file yrange.cc.

◆ setFormat()

YIndex & CNORXZ::YIndex::setFormat ( const YFormat & bs)

Set the index format.

Parameters
bsThe new format.

Definition at line 501 of file yrange.cc.

◆ setSub()

YIndex & CNORXZ::YIndex::setSub ( SizeT ind,
SizeT lex )

Set position of given sub index and update total index position.

Parameters
indSub-index number [0,dim()-1].
lexLexicographic position to be assigned to the index.

Definition at line 507 of file yrange.cc.

◆ stepSize()

UPos CNORXZ::YIndex::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 315 of file yrange.cc.

◆ stringMeta()

String CNORXZ::YIndex::stringMeta ( ) const

return string formatted meta data at current index position

Definition at line 325 of file yrange.cc.


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