CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
CNORXZ::GMIndex< FormatT, Indices > Class Template Reference

#include <mrange.h>

Inheritance diagram for CNORXZ::GMIndex< FormatT, Indices >:
CNORXZ::IndexInterface< GMIndex< FormatT, Indices... >, Tuple< Indices::MetaType... > >

Public Types

typedef IndexInterface< GMIndex< FormatT, Indices... >, Tuple< typename Indices::MetaType... > > IB
 
typedef Tuple< typename Indices::MetaType... > MetaType
 
typedef MRange< typename Indices::RangeType... > RangeType
 

Public Member Functions

 INDEX_RANDOM_ACCESS_ITERATOR_DEFS (MetaType)
 
constexpr GMIndex ()=default
 
constexpr GMIndex (GMIndex &&i)=default
 
constexpr GMIndexoperator= (GMIndex &&i)=default
 
constexpr GMIndex (const GMIndex &i)
 
constexpr GMIndexoperator= (const GMIndex &i)
 
constexpr GMIndex (const SPack< Indices... > &pack)
 
constexpr GMIndex (const FormatT &format, const SPack< Indices... > &pack)
 
constexpr GMIndex (const Sptr< Indices > &... is)
 
constexpr GMIndex (const FormatT &format, const Sptr< Indices > &... is)
 
constexpr GMIndex (const RangePtr &range, SizeT lexpos=0)
 
constexpr GMIndex (const RangePtr &range, const FormatT &format, SizeT lexpos=0)
 
GMIndexoperator= (SizeT pos)
 
GMIndexoperator++ ()
 
GMIndexoperator-- ()
 
GMIndex operator+ (Int n) const
 
GMIndex operator- (Int n) const
 
SizeT operator- (const GMIndex &i) const
 
GMIndexoperator+= (Int n)
 
GMIndexoperator-= (Int n)
 
SizeT lex () const
 
constexpr decltype(autopmax () const
 
constexpr decltype(autolmax () const
 
IndexId< 0 > id () const
 
MetaType operator* () const
 
constexpr SizeT dim () const
 
Sptr< RangeTyperange () const
 
template<SizeT I>
decltype(autostepSize (const IndexId< I > &id) const
 
String stringMeta () const
 
MetaType meta () const
 
GMIndexat (const MetaType &metaPos)
 
RangePtr prange (const GMIndex< FormatT, Indices... > &last) const
 
auto deepFormat () const
 
auto deepMax () const
 
GMIndexreformat (const Vector< SizeT > &f, const Vector< SizeT > &s)
 
template<class Xpr , class F >
constexpr decltype(autoifor (const Xpr &xpr, F &&f) const
 
bool formatIsTrivial () const
 
decltype(autoxpr (const Sptr< MIndex< Indices... > > &_this) const
 
GMIndexoperator() (const Sptr< MIndex< Indices... > > &mi)
 
GMIndexoperator() ()
 
const SPack< Indices... > & pack () const
 
const autoformat () const
 
const autolexFormat () const
 
GMIndexsetFormat (const FormatT &bs)
 
template<SizeT... Is>
constexpr decltype(automkIPack (Isq< Is... > is) const
 
template<SizeT... Is>
constexpr decltype(automkLexFormat (const SPack< Indices... > &ipack, Isq< Is... > is)
 
template<SizeT I, class Xpr , class F >
constexpr decltype(automkIFor (const Xpr &xpr, F &&f) const
 
template<class Xpr , class F >
constexpr decltype(autoifor (const Xpr &xpr, F &&f) const
 
- Public Member Functions inherited from CNORXZ::IndexInterface< GMIndex< FormatT, Indices... >, Tuple< Indices::MetaType... > >
 ~IndexInterface ()=default
 
GMIndex< FormatT, Indices... > & THIS ()
 
const GMIndex< FormatT, Indices... > & THIS () const
 
GMIndex< FormatT, Indices... > & operator++ ()
 
GMIndex< FormatT, Indices... > & operator-- ()
 
GMIndex< FormatT, Indices... > operator+ (Int n) const
 
GMIndex< FormatT, Indices... > operator- (Int n) const
 
Int operator- (const IndexInterface &i) const
 
GMIndex< FormatT, Indices... > & operator+= (Int n)
 
GMIndex< FormatT, Indices... > & 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
 
GMIndex< FormatT, Indices... > & at (const MetaType &meta)
 
RangePtr prange (const IndexInterface &end) const
 
decltype(auto) deepFormat () const
 
decltype(auto) deepMax () const
 
GMIndex< FormatT, Indices... > & reformat (const Vector< SizeT > &f, const Vector< SizeT > &s)
 
decltype(auto) ifor (const Xpr &xpr, F &&f) const
 
bool formatIsTrivial () const
 

Static Public Attributes

static constexpr SizeT NI = sizeof...(Indices)
 

Additional Inherited Members

- Protected Attributes inherited from CNORXZ::IndexInterface< GMIndex< FormatT, Indices... >, Tuple< Indices::MetaType... > >
SizeT mPos
 

Detailed Description

template<class FormatT, class... Indices>
class CNORXZ::GMIndex< FormatT, Indices >

Multi-index with fixed number of sub-indices of arbitrary type and arbitrary index format.

Template Parameters
FormatTIndex format type.
IndicesSub-index types.

Definition at line 38 of file mrange.h.

Member Typedef Documentation

◆ IB

template<class FormatT , class... Indices>
typedef IndexInterface<GMIndex<FormatT,Indices...>, Tuple<typename Indices::MetaType...> > CNORXZ::GMIndex< FormatT, Indices >::IB

Definition at line 44 of file mrange.h.

◆ MetaType

template<class FormatT , class... Indices>
typedef Tuple<typename Indices::MetaType...> CNORXZ::GMIndex< FormatT, Indices >::MetaType

Definition at line 45 of file mrange.h.

◆ RangeType

template<class FormatT , class... Indices>
typedef MRange<typename Indices::RangeType...> CNORXZ::GMIndex< FormatT, Indices >::RangeType

Definition at line 46 of file mrange.h.

Constructor & Destructor Documentation

◆ GMIndex() [1/9]

template<class FormatT , class... Indices>
constexpr CNORXZ::GMIndex< FormatT, Indices >::GMIndex ( )
constexprdefault

Default constructor.

◆ GMIndex() [2/9]

template<class FormatT , class... Indices>
constexpr CNORXZ::GMIndex< FormatT, Indices >::GMIndex ( GMIndex< FormatT, Indices > && i)
constexprdefault

Move constructor (default).

◆ GMIndex() [3/9]

template<class FormatT , class... Indices>
constexpr CNORXZ::GMIndex< FormatT, Indices >::GMIndex ( const GMIndex< FormatT, Indices > & i)
constexpr

Copy constructor (no default, copy sub-index instances).

Definition at line 155 of file mrange.cc.h.

◆ GMIndex() [4/9]

template<class FormatT , class... Indices>
constexpr CNORXZ::GMIndex< FormatT, Indices >::GMIndex ( const SPack< Indices... > & pack)
constexpr

Construct from index pack.

Definition at line 181 of file mrange.cc.h.

◆ GMIndex() [5/9]

template<class FormatT , class... Indices>
constexpr CNORXZ::GMIndex< FormatT, Indices >::GMIndex ( const FormatT & format,
const SPack< Indices... > & pack )
constexpr

Construct from index pack and format.

Definition at line 197 of file mrange.cc.h.

◆ GMIndex() [6/9]

template<class FormatT , class... Indices>
constexpr CNORXZ::GMIndex< FormatT, Indices >::GMIndex ( const Sptr< Indices > &... is)
constexpr

Construct from index pointers.

Definition at line 210 of file mrange.cc.h.

◆ GMIndex() [7/9]

template<class FormatT , class... Indices>
constexpr CNORXZ::GMIndex< FormatT, Indices >::GMIndex ( const FormatT & format,
const Sptr< Indices > &... is )
constexpr

Construct from index pointers and format.

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

◆ GMIndex() [8/9]

template<class FormatT , class... Indices>
constexpr CNORXZ::GMIndex< FormatT, Indices >::GMIndex ( const RangePtr & range,
SizeT lexpos = 0 )
constexpr

Construct from range.

Definition at line 240 of file mrange.cc.h.

◆ GMIndex() [9/9]

template<class FormatT , class... Indices>
constexpr CNORXZ::GMIndex< FormatT, Indices >::GMIndex ( const RangePtr & range,
const FormatT & format,
SizeT lexpos = 0 )
constexpr

Construct from range and format.

Definition at line 256 of file mrange.cc.h.

Member Function Documentation

◆ at()

template<class FormatT , class... Indices>
GMIndex< FormatT, Indices... > & CNORXZ::GMIndex< FormatT, Indices >::at ( const MetaType & metaPos)

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

Parameters
metameta data to be matched

Definition at line 433 of file mrange.cc.h.

◆ deepFormat()

template<class FormatT , class... Indices>
auto CNORXZ::GMIndex< FormatT, Indices >::deepFormat ( ) const

recursive index format

Definition at line 537 of file mrange.cc.h.

◆ deepMax()

template<class FormatT , class... Indices>
auto CNORXZ::GMIndex< FormatT, Indices >::deepMax ( ) const

max of all single-indices (recursive)

Definition at line 544 of file mrange.cc.h.

◆ dim()

template<class FormatT , class... Indices>
constexpr SizeT CNORXZ::GMIndex< FormatT, Indices >::dim ( ) const
constexpr

index dimension

Definition at line 392 of file mrange.cc.h.

◆ format()

template<class FormatT , class... Indices>
const auto & CNORXZ::GMIndex< FormatT, Indices >::format ( ) const

Get index format.

Definition at line 507 of file mrange.cc.h.

◆ formatIsTrivial()

template<class FormatT , class... Indices>
bool CNORXZ::GMIndex< FormatT, Indices >::formatIsTrivial ( ) const

check is format is trivial

Definition at line 461 of file mrange.cc.h.

◆ id()

template<class FormatT , class... Indices>
IndexId< 0 > CNORXZ::GMIndex< FormatT, Indices >::id ( ) const

index ID

Definition at line 380 of file mrange.cc.h.

◆ ifor() [1/2]

template<class FormatT , class... Indices>
template<class Xpr , class F >
constexpr decltype(auto) CNORXZ::GMIndex< FormatT, Indices >::ifor ( const Xpr & xpr,
F && f ) const
constexpr

Definition at line 455 of file mrange.cc.h.

◆ ifor() [2/2]

template<class FormatT , class... Indices>
template<class Xpr , class F >
constexpr decltype(auto) CNORXZ::GMIndex< FormatT, Indices >::ifor ( const Xpr & xpr,
F && f ) const
constexpr

create a for-loop expression

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

◆ INDEX_RANDOM_ACCESS_ITERATOR_DEFS()

template<class FormatT , class... Indices>
CNORXZ::GMIndex< FormatT, Indices >::INDEX_RANDOM_ACCESS_ITERATOR_DEFS ( MetaType )

◆ lex()

template<class FormatT , class... Indices>
SizeT CNORXZ::GMIndex< FormatT, Indices >::lex ( ) const

lexicographic position

Definition at line 357 of file mrange.cc.h.

◆ lexFormat()

template<class FormatT , class... Indices>
const auto & CNORXZ::GMIndex< FormatT, Indices >::lexFormat ( ) const

Get lexicographic index format.

Definition at line 518 of file mrange.cc.h.

◆ lmax()

template<class FormatT , class... Indices>
decltype(auto) constexpr CNORXZ::GMIndex< FormatT, Indices >::lmax ( ) const
constexpr

maximal lexicographic position

Definition at line 374 of file mrange.cc.h.

◆ meta()

template<class FormatT , class... Indices>
GMIndex< FormatT, Indices... >::MetaType CNORXZ::GMIndex< FormatT, Indices >::meta ( ) const

return meta data at current index position

Definition at line 426 of file mrange.cc.h.

◆ mkIFor()

template<class FormatT , class... Indices>
template<SizeT I, class Xpr , class F >
constexpr decltype(auto) CNORXZ::GMIndex< FormatT, Indices >::mkIFor ( const Xpr & xpr,
F && f ) const
constexpr

Definition at line 137 of file mrange.cc.h.

◆ mkIPack()

template<class FormatT , class... Indices>
template<SizeT... Is>
constexpr decltype(auto) CNORXZ::GMIndex< FormatT, Indices >::mkIPack ( Isq< Is... > is) const
constexpr

Definition at line 30 of file mrange.cc.h.

◆ mkLexFormat()

template<class FormatT , class... Indices>
template<SizeT... Is>
constexpr decltype(auto) CNORXZ::GMIndex< FormatT, Indices >::mkLexFormat ( const SPack< Indices... > & ipack,
Isq< Is... > is )
constexpr

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

◆ operator()() [1/2]

template<class FormatT , class... Indices>
GMIndex< FormatT, Indices... > & CNORXZ::GMIndex< FormatT, Indices >::operator() ( )

Update index position according to the sub-indices.

Definition at line 494 of file mrange.cc.h.

◆ operator()() [2/2]

template<class FormatT , class... Indices>
GMIndex< FormatT, Indices... > & CNORXZ::GMIndex< FormatT, Indices >::operator() ( const Sptr< MIndex< Indices... > > & mi)

Replace sub-index instances and update index position correspondingly.

Parameters
newindex instances.

Definition at line 486 of file mrange.cc.h.

◆ operator*()

template<class FormatT , class... Indices>
GMIndex< FormatT, Indices... >::MetaType CNORXZ::GMIndex< FormatT, Indices >::operator* ( ) const

return meta data at current index position

Definition at line 386 of file mrange.cc.h.

◆ operator+()

template<class FormatT , class... Indices>
GMIndex< FormatT, Indices... > CNORXZ::GMIndex< FormatT, Indices >::operator+ ( Int n) const

return index with lexicographic index position incremented n times

Parameters
n

Definition at line 309 of file mrange.cc.h.

◆ operator++()

template<class FormatT , class... Indices>
GMIndex< FormatT, Indices... > & CNORXZ::GMIndex< FormatT, Indices >::operator++ ( )

increment lexicographic index position

Definition at line 285 of file mrange.cc.h.

◆ operator+=()

template<class FormatT , class... Indices>
GMIndex< FormatT, Indices... > & CNORXZ::GMIndex< FormatT, Indices >::operator+= ( Int n)

increment lexicographic index position n times

Parameters
n

Definition at line 329 of file mrange.cc.h.

◆ operator-() [1/2]

template<class FormatT , class... Indices>
SizeT CNORXZ::GMIndex< FormatT, Indices >::operator- ( const GMIndex< FormatT, Indices > & i) const

Definition at line 323 of file mrange.cc.h.

◆ operator-() [2/2]

template<class FormatT , class... Indices>
GMIndex< FormatT, Indices... > CNORXZ::GMIndex< FormatT, Indices >::operator- ( Int n) const

return index with lexicographic index position decremented n times

Parameters
n

Definition at line 316 of file mrange.cc.h.

◆ operator--()

template<class FormatT , class... Indices>
GMIndex< FormatT, Indices... > & CNORXZ::GMIndex< FormatT, Indices >::operator-- ( )

decrement lexicographic index position

Definition at line 297 of file mrange.cc.h.

◆ operator-=()

template<class FormatT , class... Indices>
GMIndex< FormatT, Indices... > & CNORXZ::GMIndex< FormatT, Indices >::operator-= ( Int n)

decrement lexicographic index position n times

Parameters
n

Definition at line 343 of file mrange.cc.h.

◆ operator=() [1/3]

template<class FormatT , class... Indices>
constexpr GMIndex< FormatT, Indices... > & CNORXZ::GMIndex< FormatT, Indices >::operator= ( const GMIndex< FormatT, Indices > & i)
constexpr

Copy assignment (no default, copy sub-index instances).

Definition at line 168 of file mrange.cc.h.

◆ operator=() [2/3]

template<class FormatT , class... Indices>
constexpr GMIndex & CNORXZ::GMIndex< FormatT, Indices >::operator= ( GMIndex< FormatT, Indices > && i)
constexprdefault

Move assignment (default).

◆ operator=() [3/3]

template<class FormatT , class... Indices>
GMIndex< FormatT, Indices... > & CNORXZ::GMIndex< FormatT, Indices >::operator= ( SizeT pos)

Definition at line 269 of file mrange.cc.h.

◆ pack()

template<class FormatT , class... Indices>
const SPack< Indices... > & CNORXZ::GMIndex< FormatT, Indices >::pack ( ) const

Get index pack.

Definition at line 501 of file mrange.cc.h.

◆ pmax()

template<class FormatT , class... Indices>
decltype(auto) constexpr CNORXZ::GMIndex< FormatT, Indices >::pmax ( ) const
constexpr

maximal memory position

Definition at line 368 of file mrange.cc.h.

◆ prange()

template<class FormatT , class... Indices>
RangePtr CNORXZ::GMIndex< FormatT, Indices >::prange ( const GMIndex< FormatT, Indices... > & 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 524 of file mrange.cc.h.

◆ range()

template<class FormatT , class... Indices>
Sptr< typename GMIndex< FormatT, Indices... >::RangeType > CNORXZ::GMIndex< FormatT, Indices >::range ( ) const

pointer to the range the index is defined on

Definition at line 398 of file mrange.cc.h.

◆ reformat()

template<class FormatT , class... Indices>
GMIndex< FormatT, Indices... > & CNORXZ::GMIndex< FormatT, Indices >::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 552 of file mrange.cc.h.

◆ setFormat()

template<class FormatT , class... Indices>
GMIndex< FormatT, Indices... > & CNORXZ::GMIndex< FormatT, Indices >::setFormat ( const FormatT & bs)

Assign new index format.

Definition at line 608 of file mrange.cc.h.

◆ stepSize()

template<class FormatT , class... Indices>
template<SizeT I>
decltype(auto) CNORXZ::GMIndex< FormatT, Indices >::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 405 of file mrange.cc.h.

◆ stringMeta()

template<class FormatT , class... Indices>
String CNORXZ::GMIndex< FormatT, Indices >::stringMeta ( ) const

return string formatted meta data at current index position

Definition at line 413 of file mrange.cc.h.

◆ xpr()

template<class FormatT , class... Indices>
decltype(auto) CNORXZ::GMIndex< FormatT, Indices >::xpr ( const Sptr< MIndex< Indices... > > & _this) const

Definition at line 443 of file mrange.cc.h.

Member Data Documentation

◆ NI

template<class FormatT , class... Indices>
constexpr SizeT CNORXZ::GMIndex< FormatT, Indices >::NI = sizeof...(Indices)
staticconstexpr

Definition at line 47 of file mrange.h.


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