Simple class to store the array dimensions. More...
#include <ArraySize.h>
Public Member Functions | |
| constexpr bool | approxEqual (const ArraySize &rhs) const |
| constexpr | ArraySize () |
| Empty constructor. | |
| template<std::size_t NDIM> | |
| constexpr | ArraySize (const std::array< size_t, NDIM > &N) |
| ArraySize (const std::vector< size_t > &N) | |
| constexpr | ArraySize (size_t N1) |
| constexpr | ArraySize (size_t N1, size_t N2) |
| constexpr | ArraySize (size_t N1, size_t N2, size_t N3) |
| constexpr | ArraySize (size_t N1, size_t N2, size_t N3, size_t N4) |
| constexpr | ArraySize (size_t N1, size_t N2, size_t N3, size_t N4, size_t N5) |
| constexpr | ArraySize (size_t ndim, const size_t *dims) |
| template<class TYPE > | |
| constexpr | ArraySize (std::initializer_list< TYPE > N, int ndim=-1) |
| constexpr const size_t * | begin () const |
| Returns an iterator to the beginning. | |
| constexpr const size_t * | end () const |
| Returns an iterator to the end. | |
| constexpr std::array< size_t, 5 > | ijk (size_t index) const |
| Convert the index to ijk values. | |
| constexpr void | ijk (size_t index, size_t *x) const |
| Convert the index to ijk values. | |
| constexpr size_t | index (const std::array< size_t, 5 > &i) const |
| Get the index. | |
| constexpr size_t | index (size_t i) const |
| Get the index. | |
| constexpr size_t | index (size_t i1, size_t i2) const |
| Get the index. | |
| constexpr size_t | index (size_t i1, size_t i2, size_t i3) const |
| Get the index. | |
| constexpr size_t | index (size_t i1, size_t i2, size_t i3, size_t i4) const |
| Get the index. | |
| constexpr size_t | index (size_t i1, size_t i2, size_t i3, size_t i4, size_t i5) const |
| Get the index. | |
| constexpr size_t | index (std::initializer_list< size_t > i) const |
| Get the index. | |
| constexpr size_t | length () const |
| Return the total number of elements in the array. | |
| constexpr uint8_t | ndim () const |
| Return the number of dimensions. | |
| constexpr bool | operator!= (const ArraySize &rhs) const |
| Check if two matrices are not equal. | |
| constexpr bool | operator== (const ArraySize &rhs) const |
| constexpr size_t | operator[] (size_t i) const |
| constexpr void | resize (uint8_t dim, size_t N) |
| Resize the dimension. | |
| constexpr void | setNdim (uint8_t ndim) |
| constexpr size_t | size () const |
| Return the number of dimensions. | |
Static Public Member Functions | |
| static constexpr uint8_t | maxDim () |
| Maximum supported dimension. | |
Private Attributes | |
| size_t | d_length |
| size_t | d_N [5] |
| uint8_t | d_ndim |
Simple class to store the array dimensions.
Definition at line 137 of file ArraySize.h.
|
inlineconstexpr |
Empty constructor.
Definition at line 141 of file ArraySize.h.
|
inlineconstexpr |
Create the vector size
| N1 | Number of elements in the first dimension |
Definition at line 147 of file ArraySize.h.
|
inlineconstexpr |
Create the vector size
| N1 | Number of elements in the first dimension |
| N2 | Number of elements in the second dimension |
Definition at line 154 of file ArraySize.h.
|
inlineconstexpr |
Create the vector size
| N1 | Number of elements in the first dimension |
| N2 | Number of elements in the second dimension |
| N3 | Number of elements in the third dimension |
Definition at line 165 of file ArraySize.h.
|
inlineconstexpr |
Create the vector size
| N1 | Number of elements in the first dimension |
| N2 | Number of elements in the second dimension |
| N3 | Number of elements in the third dimension |
| N4 | Number of elements in the fourth dimension |
Definition at line 177 of file ArraySize.h.
|
inlineconstexpr |
Create the vector size
| N1 | Number of elements in the first dimension |
| N2 | Number of elements in the second dimension |
| N3 | Number of elements in the third dimension |
| N4 | Number of elements in the fourth dimeARRAY_INSISTnsion |
| N5 | Number of elements in the fifth dimension |
Definition at line 190 of file ArraySize.h.
|
inlineconstexpr |
Create from initializer list
| N | Size of the array |
| ndim | Number of dimensions |
Definition at line 201 of file ArraySize.h.
References ARRAY_INSIST, d_length, d_N, d_ndim, maxDim(), and ndim().
|
inlineconstexpr |
Create from raw pointer
| ndim | Number of dimensions |
| dims | Dimensions |
Definition at line 230 of file ArraySize.h.
References ARRAY_INSIST, d_length, d_N, d_ndim, maxDim(), and ndim().
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
Definition at line 304 of file ArraySize.h.
|
inlineconstexpr |
|
inlineconstexpr |
Returns an iterator to the end.
Definition at line 294 of file ArraySize.h.
|
inlineconstexpr |
Convert the index to ijk values.
Definition at line 379 of file ArraySize.h.
References CHECK_ARRAY_LENGTH, d_length, d_N, and index().
|
inlineconstexpr |
Convert the index to ijk values.
Definition at line 394 of file ArraySize.h.
References CHECK_ARRAY_LENGTH, d_length, d_N, and index().
|
inlineconstexpr |
|
inlineconstexpr |
Get the index.
Definition at line 316 of file ArraySize.h.
References CHECK_ARRAY_LENGTH, and d_length.
Referenced by ijk(), ijk(), index(), index(), index(), index(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), and AMP::Array< TYPE, FUN, Allocator >::operator()().
|
inlineconstexpr |
Get the index.
Definition at line 323 of file ArraySize.h.
References CHECK_ARRAY_LENGTH, d_length, d_N, and index().
|
inlineconstexpr |
Get the index.
Definition at line 331 of file ArraySize.h.
References CHECK_ARRAY_LENGTH, d_length, d_N, and index().
|
inlineconstexpr |
Get the index.
Definition at line 339 of file ArraySize.h.
References CHECK_ARRAY_LENGTH, d_length, d_N, and index().
|
inlineconstexpr |
Get the index.
Definition at line 347 of file ArraySize.h.
References CHECK_ARRAY_LENGTH, d_length, d_N, and index().
|
inlineconstexpr |
|
inlineconstexpr |
Return the total number of elements in the array.
Definition at line 271 of file ArraySize.h.
References d_length.
Referenced by approxEqual(), AMP::Array< TYPE, FUN, Allocator >::empty(), AMP::Array< TYPE, FUN, Allocator >::end(), AMP::Array< TYPE, FUN, Allocator >::end(), AMP::Materials::Property::isScalar(), AMP::Materials::Property::isVector(), AMP::Array< TYPE, FUN, Allocator >::length(), AMP::Array< TYPE, FUN, Allocator >::operator bool(), AMP::Array< TYPE, FUN, Allocator >::ptr(), and AMP::Array< TYPE, FUN, Allocator >::ptr().
|
inlinestaticconstexpr |
Maximum supported dimension.
Definition at line 313 of file ArraySize.h.
Referenced by ArraySize(), ArraySize(), AMP::cat(), and AMP::squeeze().
|
inlineconstexpr |
Return the number of dimensions.
Definition at line 265 of file ArraySize.h.
References d_ndim.
Referenced by ArraySize(), ArraySize(), AMP::cat(), AMP::Materials::Property::isTensor(), AMP::Materials::Property::isVector(), AMP::multiplySize(), AMP::Array< TYPE, FUN, Allocator >::ndim(), AMP::operator*(), AMP::operator*(), AMP::operator*(), AMP::operator+(), AMP::operator+(), AMP::operator-(), AMP::operator<<(), AMP::pop(), and setNdim().
|
inlineconstexpr |
Check if two matrices are not equal.
Definition at line 310 of file ArraySize.h.
References operator==().
|
inlineconstexpr |
|
inlineconstexpr |
Access the ith dimension
| i | Index to access |
Definition at line 262 of file ArraySize.h.
References d_N.
|
inlineconstexpr |
Resize the dimension.
Definition at line 274 of file ArraySize.h.
References ARRAY_INSIST, d_length, d_N, and d_ndim.
|
inlineconstexpr |
Reshape the Array so that the number of dimensions is the max of ndim and the largest dim>1.
| ndim | Desired number of dimensions |
Definition at line 288 of file ArraySize.h.
References d_ndim, and ndim().
Referenced by AMP::Array< TYPE, FUN, Allocator >::setNdim().
|
inlineconstexpr |
|
private |
Definition at line 410 of file ArraySize.h.
Referenced by ArraySize(), ArraySize(), ijk(), ijk(), index(), index(), index(), index(), index(), length(), and resize().
|
private |
Definition at line 411 of file ArraySize.h.
Referenced by approxEqual(), ArraySize(), ArraySize(), begin(), end(), ijk(), ijk(), index(), index(), index(), index(), index(), index(), operator==(), operator[](), and resize().
|
private |
Definition at line 409 of file ArraySize.h.
Referenced by ArraySize(), ArraySize(), end(), ndim(), operator==(), resize(), setNdim(), and size().
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:42. Comments on this page |