Template Numerical Library version\ main:0c33d623
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
TNL::Containers::SizesHolder< Index, sizes > Class Template Reference

Holds static and dynamic sizes of an N-dimensional array. More...

#include <TNL/Containers/ndarray/SizesHolder.h>

Inheritance diagram for TNL::Containers::SizesHolder< Index, sizes >:
Inheritance graph
[legend]
Collaboration diagram for TNL::Containers::SizesHolder< Index, sizes >:
Collaboration graph
[legend]

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.
 

Detailed Description

template<typename Index, std::size_t... sizes>
class TNL::Containers::SizesHolder< Index, sizes >

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.

Template Parameters
IndexIntegral type used for storing dynamic sizes.
sizesSequence 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.

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