Template Numerical Library version\ main:4e58ea6
Loading...
Searching...
No Matches
TNL::Containers::NDArray< Value, SizesHolder, Permutation, Device, Index, Overlaps, Allocator > Class Template Reference

Dynamic N-dimensional array. More...

#include <TNL/Containers/NDArray.h>

Inheritance diagram for TNL::Containers::NDArray< Value, SizesHolder, Permutation, Device, Index, Overlaps, Allocator >:
Collaboration diagram for TNL::Containers::NDArray< Value, SizesHolder, Permutation, Device, Index, Overlaps, Allocator >:

Public Types

using AllocatorType = Allocator
 Allocator type used for allocating the array.
 
- Public Types inherited from TNL::Containers::ConstStaticSizesHolder< typename SizesHolder::IndexType, SizesHolder::getDimension(), 0 >
using IndexType
 

Public Member Functions

 NDArray ()=default
 Constructs an empty array with zero size.
 
 NDArray (const AllocatorType &allocator)
 Constructs an empty array and sets the provided allocator.
 
 NDArray (const NDArray &other, const AllocatorType &allocator)
 Copy constructor with a specific allocator (makes a deep copy).
 
AllocatorType getAllocator () const
 Returns the allocator associated with the array.
 
NDArrayStorageoperator= (const NDArrayStorage &other)=default
 Copy-assignment operator for deep-copying data from another array. Mismatched sizes cause reallocations.
 
template<typename OtherArray >
NDArrayStorageoperator= (const OtherArray &other)
 Templated copy-assignment operator for deep-copying data from another array.
 
NDArrayStorageoperator= (NDArrayStorage &&) noexcept(false)=default
 Move-assignment operator for acquiring data from rvalues.
 
- Public Member Functions inherited from TNL::Containers::ConstStaticSizesHolder< typename SizesHolder::IndexType, SizesHolder::getDimension(), 0 >
__cuda_callable__ typename SizesHolder::IndexType getSize () const
 
__cuda_callable__ typename SizesHolder::IndexType operator[] (typename SizesHolder::IndexType level) const
 Returns the dynamic size along a specific axis. It is always equal to the static size.
 

Additional Inherited Members

- Static Public Member Functions inherited from TNL::Containers::ConstStaticSizesHolder< typename SizesHolder::IndexType, SizesHolder::getDimension(), 0 >
static constexpr std::size_t getDimension ()
 
static constexpr std::size_t getStaticSize ()
 
static constexpr typename SizesHolder::IndexType getStaticSize (typename SizesHolder::IndexType level)
 Returns the static size of a specific dimension identified by a runtime parameter level.
 

Detailed Description

template<typename Value, typename SizesHolder, typename Permutation = std::make_index_sequence< SizesHolder::getDimension() >, typename Device = Devices::Host, typename Index = typename SizesHolder::IndexType, typename Overlaps = ConstStaticSizesHolder< typename SizesHolder::IndexType, SizesHolder::getDimension(), 0 >, typename Allocator = typename Allocators::Default< Device >::template Allocator< Value >>
class TNL::Containers::NDArray< Value, SizesHolder, Permutation, Device, Index, Overlaps, Allocator >

Dynamic N-dimensional array.

Template Parameters
ValueType of the values stored in the array.
SizesHolderInstance of SizesHolder that will represent the array sizes.
PermutationPermutation that will be applied to indices when accessing the array elements. The identity permutation is used by default.
DeviceType of the device that will be used for running operations on the array.
IndexType of indices used for addressing the array elements.
OverlapsSequence of integers representing the overlaps in each dimension a distributed N-dimensional array.
AllocatorType of the allocator that will be used for allocating elements of the array.

See also the Users' Guide.


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