QDP++
QDP::multiNd< T > Class Template Reference

Container for a generic N dimensional array. More...

#include <qdp_multi.h>

Public Member Functions

 multiNd ()
 multiNd (const multi1d< int > &_nz)
 ~multiNd ()
 multiNd (const multiNd &s)
 Copy constructor.
void resize (const multi1d< int > &_nz)
 Allocate mem for the array.
int size (int i) const
 Size of i-th array index. Indices run from left to right in operator().
const multi1d< int > & size () const
 Size of an array containing sizes of each index.
int numElem () const
 Number of elements in the array.
multiNd< T > & operator= (const multiNd< T > &s1)
 Equal operator uses underlying = of T.
template<class T1>
multiNd< T > & operator= (const T1 &s1)
 Equal operator uses underlying = of T.
T & operator() (int i)
 Return ref to an element.
const T & operator() (int i) const
 Return const ref to an element.
T & operator() (int j, int i)
 Return ref to an element.
const T & operator() (int j, int i) const
 Return const ref to an element.
T & operator() (int k, int j, int i)
 Return ref to an element.
const T & operator() (int k, int j, int i) const
 Return const ref to an element.
T & operator() (int l, int k, int j, int i)
 Return ref to an element.
const T & operator() (int l, int k, int j, int i) const
 Return const ref to an element.
T & operator[] (const multi1d< int > &ind)
 Return ref to an element via indices packed in a multi1d array.
const T & operator[] (const multi1d< int > &ind) const
 Return ref to an element via indices packed in a multi1d array.
T & getElem (int off)
 Return ref to an element with index flattened over indices.
const T & getElem (int off) const
 Return const-ref to an element with index flattened over indices.

Detailed Description

template<class T>
class QDP::multiNd< T >

Container for a generic N dimensional array.

Definition at line 1025 of file qdp_multi.h.

Constructor & Destructor Documentation

◆ multiNd() [1/3]

template<class T>
QDP::multiNd< T >::multiNd ( )
inline

Definition at line 1028 of file qdp_multi.h.

Referenced by multiNd(), operator=(), and operator=().

◆ multiNd() [2/3]

template<class T>
QDP::multiNd< T >::multiNd ( const multi1d< int > & _nz)
inlineexplicit

Definition at line 1029 of file qdp_multi.h.

References resize().

◆ ~multiNd()

template<class T>
QDP::multiNd< T >::~multiNd ( )
inline

Definition at line 1030 of file qdp_multi.h.

◆ multiNd() [3/3]

template<class T>
QDP::multiNd< T >::multiNd ( const multiNd< T > & s)
inline

Copy constructor.

Definition at line 1033 of file qdp_multi.h.

References multiNd(), and resize().

Member Function Documentation

◆ getElem() [1/2]

template<class T>
T & QDP::multiNd< T >::getElem ( int off)
inline

Return ref to an element with index flattened over indices.

Right index is fastest varying

Definition at line 1227 of file qdp_multi.h.

Referenced by QDP::read(), and QDP::write().

◆ getElem() [2/2]

template<class T>
const T & QDP::multiNd< T >::getElem ( int off) const
inline

Return const-ref to an element with index flattened over indices.

Right index is fastest varying

Definition at line 1240 of file qdp_multi.h.

◆ numElem()

template<class T>
int QDP::multiNd< T >::numElem ( ) const
inline

Number of elements in the array.

The number of elements is the product of the sizes

Definition at line 1070 of file qdp_multi.h.

Referenced by QDP::read(), and QDP::write().

◆ operator()() [1/8]

template<class T>
T & QDP::multiNd< T >::operator() ( int i)
inline

Return ref to an element.

Definition at line 1098 of file qdp_multi.h.

◆ operator()() [2/8]

template<class T>
const T & QDP::multiNd< T >::operator() ( int i) const
inline

Return const ref to an element.

Definition at line 1110 of file qdp_multi.h.

◆ operator()() [3/8]

template<class T>
T & QDP::multiNd< T >::operator() ( int j,
int i )
inline

Return ref to an element.

Definition at line 1122 of file qdp_multi.h.

◆ operator()() [4/8]

template<class T>
const T & QDP::multiNd< T >::operator() ( int j,
int i ) const
inline

Return const ref to an element.

Definition at line 1134 of file qdp_multi.h.

◆ operator()() [5/8]

template<class T>
T & QDP::multiNd< T >::operator() ( int k,
int j,
int i )
inline

Return ref to an element.

Definition at line 1146 of file qdp_multi.h.

◆ operator()() [6/8]

template<class T>
const T & QDP::multiNd< T >::operator() ( int k,
int j,
int i ) const
inline

Return const ref to an element.

Definition at line 1158 of file qdp_multi.h.

◆ operator()() [7/8]

template<class T>
T & QDP::multiNd< T >::operator() ( int l,
int k,
int j,
int i )
inline

Return ref to an element.

Definition at line 1170 of file qdp_multi.h.

◆ operator()() [8/8]

template<class T>
const T & QDP::multiNd< T >::operator() ( int l,
int k,
int j,
int i ) const
inline

Return const ref to an element.

Definition at line 1182 of file qdp_multi.h.

◆ operator=() [1/2]

template<class T>
multiNd< T > & QDP::multiNd< T >::operator= ( const multiNd< T > & s1)
inline

Equal operator uses underlying = of T.

Definition at line 1073 of file qdp_multi.h.

References multiNd(), resize(), and size().

◆ operator=() [2/2]

template<class T>
template<class T1>
multiNd< T > & QDP::multiNd< T >::operator= ( const T1 & s1)
inline

Equal operator uses underlying = of T.

Definition at line 1084 of file qdp_multi.h.

References multiNd().

◆ operator[]() [1/2]

template<class T>
T & QDP::multiNd< T >::operator[] ( const multi1d< int > & ind)
inline

Return ref to an element via indices packed in a multi1d array.

Definition at line 1194 of file qdp_multi.h.

References QDP::multi1d< T >::size().

◆ operator[]() [2/2]

template<class T>
const T & QDP::multiNd< T >::operator[] ( const multi1d< int > & ind) const
inline

Return ref to an element via indices packed in a multi1d array.

Definition at line 1210 of file qdp_multi.h.

References QDP::multi1d< T >::size().

◆ resize()

template<class T>
void QDP::multiNd< T >::resize ( const multi1d< int > & _nz)
inline

Allocate mem for the array.

Definition at line 1042 of file qdp_multi.h.

References QDP::QDP_abort(), and QDP::multi1d< T >::size().

Referenced by multiNd(), multiNd(), operator=(), and QDP::read().

◆ size() [1/2]

template<class T>
const multi1d< int > & QDP::multiNd< T >::size ( ) const
inline

Size of an array containing sizes of each index.

Note, the last/right index is the fastest varying index

Definition at line 1066 of file qdp_multi.h.

◆ size() [2/2]

template<class T>
int QDP::multiNd< T >::size ( int i) const
inline

Size of i-th array index. Indices run from left to right in operator().

Note, the last/right index is the fastest varying index

Definition at line 1062 of file qdp_multi.h.

Referenced by operator=(), and QDP::write().


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