Chombo + EB + MF  3.2
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
CHArray< T, Rank, ArConf, Alloc > Class Template Reference

Multidimensional array class. More...

#include <CHArray.H>

Inheritance diagram for CHArray< T, Rank, ArConf, Alloc >:
Inheritance graph
[legend]

Classes

struct  Array_impl
 

Public Member Functions

 CHArray ()
 Default constructor. More...
 
 CHArray (const DimT &dim6, const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
 Construct with dimensions. More...
 
 CHArray (const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
 
 CHArray (const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
 
 CHArray (const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
 
 CHArray (const DimT &dim2, const DimT &dim1, const DimT &dim0)
 
 CHArray (const DimT &dim1, const DimT &dim0)
 
 CHArray (const DimT &dim0)
 
 CHArray (const IntVect &iv, const DimT &dimc1, const DimT &dimc0)
 
 CHArray (const IntVect &iv, const DimT &dimc0)
 
 CHArray (const DimT &dimc1, const DimT &dimc0, const IntVect &iv)
 
 CHArray (const DimT &dimc0, const IntVect &iv)
 
 CHArray (const Box &box, const DimT &dimc1, const DimT &dimc0)
 
 CHArray (const Box &box, const DimT &dimc0)
 
 CHArray (const DimT &dimc1, const DimT &dimc0, const Box &box)
 
 CHArray (const DimT &dimc0, const Box &box)
 
void define (const DimT &dim6, const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
 Define the dimensions. More...
 
void define (const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
 
void define (const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
 
void define (const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
 
void define (const DimT &dim2, const DimT &dim1, const DimT &dim0)
 
void define (const DimT &dim1, const DimT &dim0)
 
void define (const DimT &dim0)
 
void define (const IntVect &iv, const DimT &dimc1, const DimT &dimc0)
 
void define (const IntVect &iv, const DimT &dimc0)
 
void define (const DimT &dimc1, const DimT &dimc0, const IntVect &iv)
 
void define (const DimT &dimc0, const IntVect &iv)
 
void define (const Box &box, const DimT &dimc1, const DimT &dimc0)
 
void define (const Box &box, const DimT &dimc0)
 
void define (const DimT &dimc1, const DimT &dimc0, const Box &box)
 
void define (const DimT &dimc0, const Box &box)
 
void define (void *const addr, const DimT &dim6, const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
 Define the dimensions and allocate on 'addr'. More...
 
void define (void *const addr, const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
 
void define (void *const addr, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
 
void define (void *const addr, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
 
void define (void *const addr, const DimT &dim2, const DimT &dim1, const DimT &dim0)
 
void define (void *const addr, const DimT &dim1, const DimT &dim0)
 
void define (void *const addr, const DimT &dim0)
 
void define (void *const addr, const IntVect &iv, const DimT &dimc1, const DimT &dimc0)
 
void define (void *const addr, const IntVect &iv, const DimT &dimc0)
 
void define (void *const addr, const DimT &dimc1, const DimT &dimc0, const IntVect &iv)
 
void define (void *const addr, const DimT &dimc0, const IntVect &iv)
 
void define (void *const addr, const Box &box, const DimT &dimc1, const DimT &dimc0)
 
void define (void *const addr, const Box &box, const DimT &dimc0)
 
void define (void *const addr, const DimT &dimc1, const DimT &dimc0, const Box &box)
 
void define (void *const addr, const DimT &dimc0, const Box &box)
 
void undefine ()
 Deallocate the array. More...
 
template<typename T2 >
CHArrayoperator= (const T2 &val)
 Assign a constant to the array. More...
 
T & operator() (const ArSp::IIx_t i6, const ArSp::IIx_t i5, const ArSp::IIx_t i4, const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0)
 Access an element. More...
 
T & operator() (const ArSp::IIx_t i5, const ArSp::IIx_t i4, const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0)
 
T & operator() (const ArSp::IIx_t i4, const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0)
 
T & operator() (const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0)
 
T & operator() (const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0)
 
T & operator() (const ArSp::IIx_t i1, const ArSp::IIx_t i0)
 
T & operator() (const ArSp::IIx_t i0)
 
T & operator() (const IntVect &iv, const ArSp::IIx_t c1, const ArSp::IIx_t c0)
 
T & operator() (const IntVect &iv, const ArSp::IIx_t c0)
 
T & operator() (const ArSp::IIx_t c1, const ArSp::IIx_t c0, const IntVect &iv)
 
T & operator() (const ArSp::IIx_t c0, const IntVect &iv)
 
const T & operator() (const ArSp::IIx_t i6, const ArSp::IIx_t i5, const ArSp::IIx_t i4, const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0) const
 Constant access to an element. More...
 
const T & operator() (const ArSp::IIx_t i5, const ArSp::IIx_t i4, const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0) const
 
const T & operator() (const ArSp::IIx_t i4, const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0) const
 
const T & operator() (const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0) const
 
const T & operator() (const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0) const
 
const T & operator() (const ArSp::IIx_t i1, const ArSp::IIx_t i0) const
 
const T & operator() (const ArSp::IIx_t i0) const
 
const T & operator() (const IntVect &iv, const ArSp::IIx_t c1, const ArSp::IIx_t c0) const
 
const T & operator() (const IntVect &iv, const ArSp::IIx_t c0) const
 
const T & operator() (const ArSp::IIx_t c1, const ArSp::IIx_t c0, const IntVect &iv) const
 
const T & operator() (const ArSp::IIx_t c0, const IntVect &iv) const
 
Alloc & getAllocator ()
 Get the allocator. More...
 
T * begin ()
 Access extents of the memory allocated for the array. More...
 
const T * begin () const
 
T * end ()
 
const T * end () const
 
ArSp::USz_t size () const
 Overall size of the array. More...
 
ArSp::USz_t size (const unsigned dim) const
 Size of a dimension (0 is dimension with contiguous storage) More...
 
ArSp::IIx_t lowerBound (const unsigned dim) const
 Lower bound of a dimension (0 is dimension with contiguous storage) More...
 
ArSp::IIx_t upperBound (const unsigned dim) const
 Upper bound of a dimension (0 is dimension with contiguous storage) More...
 
ArSp::IIx_t totalOffset () const
 Offset from non-zero lower bound. More...
 
bool isAllocated () const
 Memory has been allocated. More...
 
bool isUsable () const
 Memory has been allocated and size is > 0. More...
 

Static Public Member Functions

static constexpr unsigned rank () noexcept
 Rank of the array. More...
 

Private Types

typedef ArSp::ArTr< Rank, ArConf >::DimT DimT
 
typedef ArSp::ArTr< Rank, ArConf >::IndexerT Indexer
 
typedef T value_type
 Type of element. More...
 

Private Member Functions

 CHArray (const CHArray &)
 
CHArrayoperator= (const CHArray &)
 

Private Attributes

Array_impl m_arrayImpl
 Data + allocation/deallocation. More...
 

Detailed Description

template<typename T, unsigned Rank, int ArConf, typename Alloc>
class CHArray< T, Rank, ArConf, Alloc >

Multidimensional array class.

Template Parameters
TType of element
RankRank of the array
ArConfConfiguration of the indexing. Allowable values are: ArZeroRow - Row-ordered indexing with lower bound = 0 ArZeroCol - Column-ordered indexing with lower bound = 0 (DEFAULT) ArRangeRow - Row-ordered indexing with subscript ranges ArRangeCol - Column-ordered indexing with subscript ranges
AllocAllocator for the array
Note
  • Default template arguments specify column-ordered arrays since it is expected that this class will be mostly used as storage for data used in Fortran routines.
  • When an assertion fails, note that the indexers label the contiguous dimension as i0 or dim0 and the others from there. This class labels all dimensions assuming row-ordered (C) storage.
  • Currently supports up to rank 7, matching the maximum permitted by the Fortran 2003 standard (the 2008 standard extends this to 15 and this class will be extended once that is commonplace). With IntVects or Boxes used to specify some of the dimensions, 2 extra dimensions are supported, allowing a matrix in each cell. This implies a rank of SpaceDim+2 so you can only add 1 extra dimension if you want to support SpaceDim=6.
  • Empty base-class optimizations are frequently used. On 32-bit arch, sizeof(CHArray<int, 1, ArZeroRow, ArSp::NewArrayAlloc<int> >) = 8 sizeof(CHArray<int, 2, ArZeroRow, ArSp::NewArrayAlloc<int> >) = 12
  • There is support for passing these arrays to Fortran – see Chombo design doc
  • CHMatrix will define a real, rank 2, column-ordered matrix
  • You can also allocate an array of matrices, continguous in memory, using the ArrayOfMatrixAlloc allocator.

Example

*
*     CHArray<int, 3> A(2, 2, 2);
*     A = 2;
*     A(0, 0, 0) = 4;
*     std::cout << A << std::endl;
*     CHArray<double, 2> B;
*     B.define(3, 4);
*     B(2, 3) = 5.5;
*                                                                  

One can also use subscript ranges but the array has to be configured to support this. Ranges are specified with CHRange in place of a size. Any integer types are converted to CHRange(0, int-1). E.g.,

*     CHArray<int, 3, ArRangeRow> C(CHRange(-1,0), 2, 2);
*     C = 2;
*     C(-1, 0, 0) = 4;
*                                                                  

IntVects are allowed for specifying some of the dimensions so that this class can be used with boxes, e.g:

*
*     CHArray<int, SpaceDim+1> A(box.size(), 1)
*                                                                  

The indices of the IntVect are rearranged so that the first index is always closest to contiguous memory no matter if the actual memory layout is row- ordered or column-ordered. In other words, the first index of the IntVect always has the lowest stride. As such, the allocated memory can be accessed by iterating over the box in Chombo Fortran. Whether the remaining indices (or components) are left or right of the IntVect and the storage order determine if the components are distributed across the IntVects (like with a BaseFab) or are contiguous in each IntVect. The effect is natural; for row storage, components on the right will lead to contigous memory. E.g.,

*     typedef CHArray<int, SpaceDim+1, ArZeroRow> CHArrayRS;
*     typedef CHArray<int, SpaceDim+1, ArZeroCol> CHArrayCS;
*     const IntVect iv(2, 2);
*     CHArrayRS ARS_IVComp(iv, 2);
*     CHArrayRS ARS_CompIV(2, iv);
*     CHArrayCS ACS_IVComp(iv, 2);
*     CHArrayCS ACS_CompIV(2, iv);
*     int ic = 1;
*     for (int j = 0; j != 2; ++j)
*       for (int i = 0; i != 2; ++i)  // Column storage!
*         {
*           const IntVect ixv(i, j);
*           ARS_IVComp(ixv, 0) = ic;
*           ARS_IVComp(ixv, 1) = -ic;
*           ARS_CompIV(0, ixv) = ic;
*           ARS_CompIV(1, ixv) = -ic;
*           ACS_IVComp(ixv, 0) = ic;
*           ACS_IVComp(ixv, 1) = -ic;
*           ACS_CompIV(0, ixv) = ic;
*           ACS_CompIV(1, ixv) = -ic;
*           ++ic;
*         }
*
*     std::cout << "ARS_IVComp: " << ARS_IVComp << std::endl;
*     std::cout << "ARS_CompIV: " << ARS_CompIV << std::endl;
*     std::cout << "ACS_IVComp: " << ACS_IVComp << std::endl;
*     std::cout << "ACS_CompIV: " << ACS_CompIV << std::endl;
*                                                                  

will produce

*     $ ARS_IVComp: 1 -1 2 -2 3 -3 4 -4
*     $ ARS_CompIV: 1 2 3 4 -1 -2 -3 -4
*     $ ACS_IVComp: 1 2 3 4 -1 -2 -3 -4
*     $ ACS_CompIV: 1 -1 2 -2 3 -3 4 -4
*                                                                  

Note that the IntVects simply expand to dimensions and there is nothing to ensure that you access in the array in the same manner you defined it (i.e., switching the order of the IntVect and the component)!

IntVects are always zero-based and there is no way to specify a range of IntVects. However, one can use Boxes instead of IntVects to define the array but only if the array is configured with subscript ranges (ArConf = ArRangeRow or ArRangeCol)

*     Box box(IntVect(-1,-1), IntVect(1, 1));
*     CHArray<int, SpaceDim+1, ArRangeRow> AB(box, 2);
*     AB = 1;
*     AB(IntVect(-1, -1), 0) = 2;
*     std::cout << AB << std::endl;
*                                                                  

Member Typedef Documentation

◆ DimT

template<typename T, unsigned Rank, int ArConf, typename Alloc>
typedef ArSp::ArTr<Rank, ArConf>::DimT CHArray< T, Rank, ArConf, Alloc >::DimT
private

◆ Indexer

template<typename T, unsigned Rank, int ArConf, typename Alloc>
typedef ArSp::ArTr<Rank, ArConf>::IndexerT CHArray< T, Rank, ArConf, Alloc >::Indexer
private

◆ value_type

template<typename T, unsigned Rank, int ArConf, typename Alloc>
typedef T CHArray< T, Rank, ArConf, Alloc >::value_type
private

Type of element.

Constructor & Destructor Documentation

◆ CHArray() [1/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( )
inline

Default constructor.

◆ CHArray() [2/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const DimT dim6,
const DimT dim5,
const DimT dim4,
const DimT dim3,
const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

Construct with dimensions.

◆ CHArray() [3/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const DimT dim5,
const DimT dim4,
const DimT dim3,
const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

◆ CHArray() [4/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const DimT dim4,
const DimT dim3,
const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

◆ CHArray() [5/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const DimT dim3,
const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

◆ CHArray() [6/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

◆ CHArray() [7/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const DimT dim1,
const DimT dim0 
)
inline

◆ CHArray() [8/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const DimT dim0)
inline

◆ CHArray() [9/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const IntVect iv,
const DimT dimc1,
const DimT dimc0 
)
inline

◆ CHArray() [10/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const IntVect iv,
const DimT dimc0 
)
inline

◆ CHArray() [11/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const DimT dimc1,
const DimT dimc0,
const IntVect iv 
)
inline

◆ CHArray() [12/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const DimT dimc0,
const IntVect iv 
)
inline

◆ CHArray() [13/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const Box box,
const DimT dimc1,
const DimT dimc0 
)
inline

◆ CHArray() [14/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const Box box,
const DimT dimc0 
)
inline

◆ CHArray() [15/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const DimT dimc1,
const DimT dimc0,
const Box box 
)
inline

◆ CHArray() [16/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const DimT dimc0,
const Box box 
)
inline

◆ CHArray() [17/17]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray< T, Rank, ArConf, Alloc >::CHArray ( const CHArray< T, Rank, ArConf, Alloc > &  )
private

Member Function Documentation

◆ define() [1/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const DimT dim6,
const DimT dim5,
const DimT dim4,
const DimT dim3,
const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

◆ define() [2/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const DimT dim5,
const DimT dim4,
const DimT dim3,
const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

◆ define() [3/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const DimT dim4,
const DimT dim3,
const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

◆ define() [4/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const DimT dim3,
const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

◆ define() [5/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

◆ define() [6/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const DimT dim1,
const DimT dim0 
)
inline

◆ define() [7/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const DimT dim0)
inline

◆ define() [8/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const IntVect iv,
const DimT dimc1,
const DimT dimc0 
)
inline

◆ define() [9/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const IntVect iv,
const DimT dimc0 
)
inline

◆ define() [10/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const DimT dimc1,
const DimT dimc0,
const IntVect iv 
)
inline

◆ define() [11/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const DimT dimc0,
const IntVect iv 
)
inline

◆ define() [12/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const Box box,
const DimT dimc1,
const DimT dimc0 
)
inline

◆ define() [13/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const Box box,
const DimT dimc0 
)
inline

◆ define() [14/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const DimT dimc1,
const DimT dimc0,
const Box box 
)
inline

◆ define() [15/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( const DimT dimc0,
const Box box 
)
inline

◆ define() [16/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const DimT dim6,
const DimT dim5,
const DimT dim4,
const DimT dim3,
const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

Define the dimensions and allocate on 'addr'.

◆ define() [17/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const DimT dim5,
const DimT dim4,
const DimT dim3,
const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

◆ define() [18/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const DimT dim4,
const DimT dim3,
const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

◆ define() [19/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const DimT dim3,
const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

◆ define() [20/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const DimT dim2,
const DimT dim1,
const DimT dim0 
)
inline

◆ define() [21/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const DimT dim1,
const DimT dim0 
)
inline

◆ define() [22/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const DimT dim0 
)
inline

◆ define() [23/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const IntVect iv,
const DimT dimc1,
const DimT dimc0 
)
inline

◆ define() [24/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const IntVect iv,
const DimT dimc0 
)
inline

◆ define() [25/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const DimT dimc1,
const DimT dimc0,
const IntVect iv 
)
inline

◆ define() [26/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const DimT dimc0,
const IntVect iv 
)
inline

◆ define() [27/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const Box box,
const DimT dimc1,
const DimT dimc0 
)
inline

◆ define() [28/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const Box box,
const DimT dimc0 
)
inline

◆ define() [29/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const DimT dimc1,
const DimT dimc0,
const Box box 
)
inline

◆ define() [30/30]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::define ( void *const  addr,
const DimT dimc0,
const Box box 
)
inline

◆ undefine()

template<typename T, unsigned Rank, int ArConf, typename Alloc>
void CHArray< T, Rank, ArConf, Alloc >::undefine ( )
inline

Deallocate the array.

◆ operator=() [1/2]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
template<typename T2 >
CHArray& CHArray< T, Rank, ArConf, Alloc >::operator= ( const T2 &  val)
inline

Assign a constant to the array.

◆ operator()() [1/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  i6,
const ArSp::IIx_t  i5,
const ArSp::IIx_t  i4,
const ArSp::IIx_t  i3,
const ArSp::IIx_t  i2,
const ArSp::IIx_t  i1,
const ArSp::IIx_t  i0 
)
inline

Access an element.

◆ operator()() [2/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  i5,
const ArSp::IIx_t  i4,
const ArSp::IIx_t  i3,
const ArSp::IIx_t  i2,
const ArSp::IIx_t  i1,
const ArSp::IIx_t  i0 
)
inline

◆ operator()() [3/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  i4,
const ArSp::IIx_t  i3,
const ArSp::IIx_t  i2,
const ArSp::IIx_t  i1,
const ArSp::IIx_t  i0 
)
inline

◆ operator()() [4/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  i3,
const ArSp::IIx_t  i2,
const ArSp::IIx_t  i1,
const ArSp::IIx_t  i0 
)
inline

◆ operator()() [5/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  i2,
const ArSp::IIx_t  i1,
const ArSp::IIx_t  i0 
)
inline

◆ operator()() [6/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  i1,
const ArSp::IIx_t  i0 
)
inline

◆ operator()() [7/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  i0)
inline

◆ operator()() [8/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const IntVect iv,
const ArSp::IIx_t  c1,
const ArSp::IIx_t  c0 
)
inline

◆ operator()() [9/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const IntVect iv,
const ArSp::IIx_t  c0 
)
inline

◆ operator()() [10/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  c1,
const ArSp::IIx_t  c0,
const IntVect iv 
)
inline

◆ operator()() [11/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  c0,
const IntVect iv 
)
inline

◆ operator()() [12/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
const T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  i6,
const ArSp::IIx_t  i5,
const ArSp::IIx_t  i4,
const ArSp::IIx_t  i3,
const ArSp::IIx_t  i2,
const ArSp::IIx_t  i1,
const ArSp::IIx_t  i0 
) const
inline

Constant access to an element.

◆ operator()() [13/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
const T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  i5,
const ArSp::IIx_t  i4,
const ArSp::IIx_t  i3,
const ArSp::IIx_t  i2,
const ArSp::IIx_t  i1,
const ArSp::IIx_t  i0 
) const
inline

◆ operator()() [14/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
const T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  i4,
const ArSp::IIx_t  i3,
const ArSp::IIx_t  i2,
const ArSp::IIx_t  i1,
const ArSp::IIx_t  i0 
) const
inline

◆ operator()() [15/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
const T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  i3,
const ArSp::IIx_t  i2,
const ArSp::IIx_t  i1,
const ArSp::IIx_t  i0 
) const
inline

◆ operator()() [16/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
const T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  i2,
const ArSp::IIx_t  i1,
const ArSp::IIx_t  i0 
) const
inline

◆ operator()() [17/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
const T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  i1,
const ArSp::IIx_t  i0 
) const
inline

◆ operator()() [18/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
const T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  i0) const
inline

◆ operator()() [19/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
const T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const IntVect iv,
const ArSp::IIx_t  c1,
const ArSp::IIx_t  c0 
) const
inline

◆ operator()() [20/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
const T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const IntVect iv,
const ArSp::IIx_t  c0 
) const
inline

◆ operator()() [21/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
const T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  c1,
const ArSp::IIx_t  c0,
const IntVect iv 
) const
inline

◆ operator()() [22/22]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
const T& CHArray< T, Rank, ArConf, Alloc >::operator() ( const ArSp::IIx_t  c0,
const IntVect iv 
) const
inline

◆ getAllocator()

template<typename T, unsigned Rank, int ArConf, typename Alloc>
Alloc& CHArray< T, Rank, ArConf, Alloc >::getAllocator ( )
inline

Get the allocator.

◆ begin() [1/2]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
T* CHArray< T, Rank, ArConf, Alloc >::begin ( )
inline

Access extents of the memory allocated for the array.

Referenced by operator<<().

◆ begin() [2/2]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
const T* CHArray< T, Rank, ArConf, Alloc >::begin ( ) const
inline

◆ end() [1/2]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
T* CHArray< T, Rank, ArConf, Alloc >::end ( )
inline

Referenced by operator<<().

◆ end() [2/2]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
const T* CHArray< T, Rank, ArConf, Alloc >::end ( ) const
inline

◆ rank()

template<typename T, unsigned Rank, int ArConf, typename Alloc>
static constexpr unsigned CHArray< T, Rank, ArConf, Alloc >::rank ( )
inlinestaticnoexcept

Rank of the array.

◆ size() [1/2]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
ArSp::USz_t CHArray< T, Rank, ArConf, Alloc >::size ( ) const
inline

Overall size of the array.

Referenced by operator<<().

◆ size() [2/2]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
ArSp::USz_t CHArray< T, Rank, ArConf, Alloc >::size ( const unsigned  dim) const
inline

Size of a dimension (0 is dimension with contiguous storage)

◆ lowerBound()

template<typename T, unsigned Rank, int ArConf, typename Alloc>
ArSp::IIx_t CHArray< T, Rank, ArConf, Alloc >::lowerBound ( const unsigned  dim) const
inline

Lower bound of a dimension (0 is dimension with contiguous storage)

◆ upperBound()

template<typename T, unsigned Rank, int ArConf, typename Alloc>
ArSp::IIx_t CHArray< T, Rank, ArConf, Alloc >::upperBound ( const unsigned  dim) const
inline

Upper bound of a dimension (0 is dimension with contiguous storage)

◆ totalOffset()

template<typename T, unsigned Rank, int ArConf, typename Alloc>
ArSp::IIx_t CHArray< T, Rank, ArConf, Alloc >::totalOffset ( ) const
inline

Offset from non-zero lower bound.

◆ isAllocated()

template<typename T, unsigned Rank, int ArConf, typename Alloc>
bool CHArray< T, Rank, ArConf, Alloc >::isAllocated ( ) const
inline

Memory has been allocated.

Referenced by operator<<().

◆ isUsable()

template<typename T, unsigned Rank, int ArConf, typename Alloc>
bool CHArray< T, Rank, ArConf, Alloc >::isUsable ( ) const
inline

Memory has been allocated and size is > 0.

◆ operator=() [2/2]

template<typename T, unsigned Rank, int ArConf, typename Alloc>
CHArray& CHArray< T, Rank, ArConf, Alloc >::operator= ( const CHArray< T, Rank, ArConf, Alloc > &  )
private

Member Data Documentation

◆ m_arrayImpl

template<typename T, unsigned Rank, int ArConf, typename Alloc>
Array_impl CHArray< T, Rank, ArConf, Alloc >::m_arrayImpl
private

Data + allocation/deallocation.


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