C++ Utilities
4.17.0
Useful C++ classes and routines such as argument parser, IO and conversion utilities
|
The MultiArray class provides an N-dimensional array. More...
#include <multiarray.h>
Public Member Functions | |
MultiArray (Dimensions... dimensionSizes) | |
Constructs a new N-dimensional array. The sizes for the dimensions are passed as arguments. More... | |
std::size_t | totalSize () const |
Returns the total number of elements. More... | |
template<std::size_t index> | |
std::size_t | dimensionSize () const |
Returns the number of elements in the specified dimension. More... | |
T & | at (Dimensions... indices) |
Returns the element at the position specified via indices. More... | |
const T & | at (Dimensions... indices) const |
Returns the element at the position specified via indices. More... | |
T * | data () |
Returns a pointer to the raw data. More... | |
const T * | data () const |
Returns a pointer to the raw data. More... | |
UnderlyingContainer::template Type< T > & | buffer () |
Allows accessing the underlying buffer directly. More... | |
Static Public Member Functions | |
static constexpr std::size_t | dimensionCount () |
Returns the number of dimensions for that type of array. More... | |
The MultiArray class provides an N-dimensional array.
Definition at line 73 of file multiarray.h.
MiscUtilities::MultiArray< T, UnderlyingContainer, Dimensions >::MultiArray | ( | Dimensions... | dimensionSizes | ) |
Constructs a new N-dimensional array. The sizes for the dimensions are passed as arguments.
Definition at line 96 of file multiarray.h.
T & MiscUtilities::MultiArray< T, UnderlyingContainer, Dimensions >::at | ( | Dimensions... | indices | ) |
Returns the element at the position specified via indices.
Definition at line 128 of file multiarray.h.
const T & MiscUtilities::MultiArray< T, UnderlyingContainer, Dimensions >::at | ( | Dimensions... | indices | ) | const |
Returns the element at the position specified via indices.
Definition at line 136 of file multiarray.h.
UnderlyingContainer::template Type< T > & MiscUtilities::MultiArray< T, UnderlyingContainer, Dimensions >::buffer | ( | ) |
Allows accessing the underlying buffer directly.
Definition at line 158 of file multiarray.h.
T * MiscUtilities::MultiArray< T, UnderlyingContainer, Dimensions >::data | ( | ) |
Returns a pointer to the raw data.
Definition at line 143 of file multiarray.h.
const T * MiscUtilities::MultiArray< T, UnderlyingContainer, Dimensions >::data | ( | ) | const |
Returns a pointer to the raw data.
Definition at line 150 of file multiarray.h.
|
static |
Returns the number of dimensions for that type of array.
Definition at line 112 of file multiarray.h.
std::size_t MiscUtilities::MultiArray< T, UnderlyingContainer, Dimensions >::dimensionSize | ( | ) | const |
Returns the number of elements in the specified dimension.
Definition at line 120 of file multiarray.h.
std::size_t MiscUtilities::MultiArray< T, UnderlyingContainer, Dimensions >::totalSize | ( | ) | const |
Returns the total number of elements.
Definition at line 105 of file multiarray.h.