Navigation
API > API/Plugins > API/Plugins/Learning
Templated dynamic multi-dimensional array
A dynamically sized array of typed elements. Makes the assumption that your elements are relocatable; i.e. that they can be transparently moved to new memory without a copy constructor.
| Name | TMultiArray |
| Type | class |
| Header File | /Engine/Plugins/Experimental/LearningAgents/Source/Learning/Public/MultiArray.h |
| Include Path | #include "MultiArray.h" |
Syntax
template<uint8 InDimNum, typename InElementType, typename InAllocatorType>
class TMultiArray
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TMultiArray () |
Constructor, initializes element number counters. | MultiArray.h | |
TMultiArray
(
const TMultiArrayView< DimNum, OtherElementType >& Other |
MultiArray.h | ||
TMultiArray
(
const TMultiArray< DimNum, OtherElementType, OtherAllocator >& Other |
Copy constructor with changed allocator. Use the common routine to perform the copy. | MultiArray.h | |
TMultiArray
(
const TMultiArray& Other |
Copy constructor. Use the common routine to perform the copy. | MultiArray.h | |
TMultiArray
(
TMultiArray&& Other |
Move constructor. | MultiArray.h | |
TMultiArray
(
TMultiArray< DimNum, OtherElementType, OtherAllocator >&& Other |
Move constructor. | MultiArray.h | |
TMultiArray
(
const ElementType* Ptr, |
Constructor from a raw array of elements. | MultiArray.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TMultiArray() |
Destructor. | MultiArray.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| AllocatorType | InAllocatorType | MultiArray.h | |
| ElementAllocatorType | std::conditional_t< AllocatorType::NeedsElementType, typename AllocatorType::template ForElementType< ElementType >, typename AllocatorType::ForAnyElementType > | MultiArray.h | |
| ElementType | InElementType | MultiArray.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| DimNum | uint8 | MultiArray.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const ElementType * begin () |
DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support. | MultiArray.h | |
ElementType * begin () |
DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support. | MultiArray.h | |
void CheckInvariants() |
Checks array invariants: if array size is greater than zero and less than maximum. | MultiArray.h | |
bool Contains
(
const ComparisonType& Item |
Checks if this array contains the element. | MultiArray.h | |
void DimensionCheck
(
uint8 Dimension |
Checks if a dimension is within the allowed number of dimensions | MultiArray.h | |
void Empty() |
Empties the array. It calls the destructors on held items if needed. | MultiArray.h | |
const ElementType * end () |
MultiArray.h | ||
ElementType * end () |
MultiArray.h | ||
TMultiArrayView< DimNum - 1, const ElementType > Flatten
(
uint8 Dimension |
Flattens the array on a given dimension, merging that dimension and the following one. | MultiArray.h | |
TMultiArrayView< DimNum - 1, ElementType > Flatten
(
uint8 Dimension |
Flattens the array on a given dimension, merging that dimension and the following one. | MultiArray.h | |
TMultiArrayView< DimNum - 1, ElementType > Flatten () |
Flattens the array on a given dimension, merging that dimension and the following one. | MultiArray.h | |
TMultiArrayView< 1, const ElementType > Flatten () |
Flattens the array view into a single dimension. | MultiArray.h | |
TMultiArrayView< 1, ElementType > Flatten () |
Flattens the array view into a single dimension. | MultiArray.h | |
TMultiArrayView< DimNum - 1, const ElementType > Flatten () |
Flattens the array on a given dimension, merging that dimension and the following one. | MultiArray.h | |
ElementAllocatorType & GetAllocatorInstance () |
MultiArray.h | ||
const ElementAllocatorType & GetAllocatorInstance () |
MultiArray.h | ||
ElementType * GetData () |
Helper function for returning a typed pointer to the first array entry. | MultiArray.h | |
const ElementType * GetData () |
Helper function for returning a typed pointer to the first array entry. | MultiArray.h | |
uint32 GetTypeSize() |
Helper function returning the size of the inner type. | MultiArray.h | |
bool IsEmpty
(
uint8 Dimension |
Returns true if the dimension is empty and contains no elements. | MultiArray.h | |
bool IsEmpty () |
Returns true if the array is empty and contains no elements. | MultiArray.h | |
int64 Num
(
uint8 Dimension |
Returns number of elements in a dimension. | MultiArray.h | |
int64 Num () |
Returns number of elements in a dimension. | MultiArray.h | |
int64 Num () |
Returns total number of elements | MultiArray.h | |
int64 NumBytes() |
Returns the total number of bytes used by the array | MultiArray.h | |
void RangeCheck
(
uint8 Dimension, |
Checks if index is in dimension range. | MultiArray.h | |
uint8 Rank() |
Returns number of dimensions. | MultiArray.h | |
void SetNum
(
TMultiArrayShape< DimNum > NewShape |
Resizes array to given number of elements. | MultiArray.h | |
void SetNumUninitialized
(
TMultiArrayShape< DimNum > NewShape |
Resizes array to given number of elements. New elements will be uninitialized. | MultiArray.h | |
void SetNumZeroed
(
TMultiArrayShape< DimNum > NewShape |
Resizes array to given number of elements. New elements will be zeroed. | MultiArray.h | |
TMultiArrayShape< DimNum > Shape() |
Returns the number of elements in each dimension. | MultiArray.h | |
TMultiArrayView< DimNum, const ElementType > Slice
(
int64 Index, |
Returns a sliced view. Slicing outside of the range of the view is illegal. | MultiArray.h | |
TMultiArrayView< DimNum, ElementType > Slice
(
int64 Index, |
Returns a sliced view. Slicing outside of the range of the view is illegal. | MultiArray.h | |
void SliceRangeCheck
(
uint8 Dimension, |
Checks if a slice range [Index, Index+InNum) is in dimension range. | MultiArray.h | |
int64 Stride
(
uint8 Dimension |
Returns the stride for a dimension. | MultiArray.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void MoveOrCopy
(
ToArrayType& ToArray, |
Moves or copies array. Depends on the array type traits.This override copies. | MultiArray.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TMultiArrayView< DimNum - 1, ElementType > operator[]
(
int64 Index |
Array bracket operator. Returns reference to element at given index. | MultiArray.h | |
TMultiArrayView< DimNum - 1, const ElementType > operator[]
(
int64 Index |
Array bracket operator. Returns reference to element at given index.Const version of the above. | MultiArray.h | |
TMultiArray & operator=
(
TMultiArray&& Other |
Move assignment operator. | MultiArray.h | |
TMultiArray & operator=
(
const TMultiArray< DimNum, ElementType, OtherAllocatorType >& Other |
Assignment operator. | MultiArray.h | |
TMultiArray & operator=
(
const TMultiArray& Other |
Assignment operator. | MultiArray.h | |
TMultiArray & operator=
(
const TMultiArrayView< DimNum, OtherElementType >& Other |
MultiArray.h |