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

Container for a multi-dimensional 2D array. More...

#include <qdp_multi.h>

Public Member Functions

 multi2d ()
 multi2d (T *f, int ns2, int ns1)
 multi2d (int ns2, int ns1)
 ~multi2d ()
 multi2d (const multi2d &s)
 Copy constructor.
void resize (int ns2, int ns1)
 Allocate mem for the array.
int size1 () const
 Size of array.
int size2 () const
int nrows () const
 Another variant on the size of the 2d array.
int ncols () const
multi2d< T > & operator= (const multi2d< T > &s1)
 Equal operator uses underlying = of T.
template<class T1>
multi2d< T > & operator= (const T1 &s1)
 Equal operator uses underlying = of T.
const T * slice (int j) const
 Return ref to a row slice.
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.
multi1d< T > operator[] (int j)
 Return ref to an element.
const multi1d< T > operator[] (int j) const
 Return const ref to an element.

Detailed Description

template<class T>
class QDP::multi2d< T >

Container for a multi-dimensional 2D array.

Definition at line 639 of file qdp_multi.h.

Constructor & Destructor Documentation

◆ multi2d() [1/4]

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

Definition at line 642 of file qdp_multi.h.

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

◆ multi2d() [2/4]

template<class T>
QDP::multi2d< T >::multi2d ( T * f,
int ns2,
int ns1 )
inline

Definition at line 643 of file qdp_multi.h.

◆ multi2d() [3/4]

template<class T>
QDP::multi2d< T >::multi2d ( int ns2,
int ns1 )
inlineexplicit

Definition at line 644 of file qdp_multi.h.

References resize().

◆ ~multi2d()

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

Definition at line 645 of file qdp_multi.h.

◆ multi2d() [4/4]

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

Copy constructor.

Definition at line 648 of file qdp_multi.h.

References multi2d(), and resize().

Member Function Documentation

◆ ncols()

template<class T>
int QDP::multi2d< T >::ncols ( ) const
inline

Definition at line 678 of file qdp_multi.h.

◆ nrows()

template<class T>
int QDP::multi2d< T >::nrows ( ) const
inline

Another variant on the size of the 2d array.

Definition at line 677 of file qdp_multi.h.

◆ operator()() [1/2]

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

Return ref to an element.

Definition at line 709 of file qdp_multi.h.

◆ operator()() [2/2]

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

Return const ref to an element.

Definition at line 712 of file qdp_multi.h.

◆ operator=() [1/2]

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

Equal operator uses underlying = of T.

Definition at line 681 of file qdp_multi.h.

References multi2d(), resize(), size1(), and size2().

◆ operator=() [2/2]

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

Equal operator uses underlying = of T.

Definition at line 692 of file qdp_multi.h.

References multi2d().

◆ operator[]() [1/2]

template<class T>
multi1d< T > QDP::multi2d< T >::operator[] ( int j)
inline

Return ref to an element.

Definition at line 715 of file qdp_multi.h.

◆ operator[]() [2/2]

template<class T>
const multi1d< T > QDP::multi2d< T >::operator[] ( int j) const
inline

Return const ref to an element.

Definition at line 718 of file qdp_multi.h.

◆ resize()

template<class T>
void QDP::multi2d< T >::resize ( int ns2,
int ns1 )
inline

Allocate mem for the array.

Definition at line 657 of file qdp_multi.h.

References QDP::QDP_error_exit().

Referenced by multi2d(), multi2d(), operator=(), QDP::HDF5::rd(), and QDP::read().

◆ size1()

template<class T>
int QDP::multi2d< T >::size1 ( ) const
inline

◆ size2()

template<class T>
int QDP::multi2d< T >::size2 ( ) const
inline

◆ slice()

template<class T>
const T * QDP::multi2d< T >::slice ( int j) const
inline

Return ref to a row slice.

Definition at line 706 of file qdp_multi.h.

Referenced by QDP::QDPInternal::globalSumArray().


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