Template Numerical Library version\ main:0c33d623
|
Holds static and dynamic sizes of an N-dimensional array. More...
#include <TNL/Containers/ndarray/SizesHolder.h>
Public Types | |
using | IndexType = Index |
Public Member Functions | |
SizesHolder ()=default | |
Default constructor. | |
template<typename... Indices, std::enable_if_t< sizeof...(Indices)==sizeof...(sizes), bool > = true> | |
SizesHolder (Indices... _sizes) | |
Constructs the holder from given pack of sizes. | |
template<std::size_t level> | |
__cuda_callable__ Index | getSize () const |
Returns the dynamic size along a specific axis. | |
__cuda_callable__ bool | operator!= (const SizesHolder &other) const |
Compares the sizes with another instance of the holder. | |
__cuda_callable__ bool | operator== (const SizesHolder &other) const |
Compares the sizes with another instance of the holder. | |
template<std::size_t level> | |
__cuda_callable__ void | setSize (Index size) |
Sets the dynamic size along a specific axis. | |
Static Public Member Functions | |
static constexpr std::size_t | getDimension () |
Returns the dimension of the array, i.e. number of sizes specified in the template parameters. | |
template<std::size_t level> | |
static constexpr std::size_t | getStaticSize () |
Returns the static size of a specific dimension. | |
Holds static and dynamic sizes of an N-dimensional array.
The dimension of the array and static sizes are specified as std::size_t, the type of dynamic sizes is configurable with Index.
Index | Integral type used for storing dynamic sizes. |
sizes | Sequence of integers specifying static and dynamic sizes. The number of integers in the sequence specifies the dimension of the array. Positive values specify static sizes, zeros specify dynamic sizes that must be set at run-time via setSize. |