Navigation
API > API/Plugins > API/Plugins/Learning
References
| Module | Learning |
| Header | /Engine/Plugins/Experimental/LearningAgents/Source/Learning/Public/MultiArray.h |
| Include | #include "MultiArray.h" |
Syntax
template<uint8 InDimNum, typename InElementType, typename InAllocatorType, bool bInIsChecked, bool bInIsRestrict>
class TMultiArray
Remarks
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.
Variables
| Type | Name | Description | |
|---|---|---|---|
| ElementAllocatorType | AllocatorInstance | ||
| TMultiArrayShape< DimNum, SizeType > | ArrayShape |
Constructors
| Type | Name | Description | |
|---|---|---|---|
TMultiArray () |
Constructor, initializes element number counters. | ||
TMultiArray
(
const TMultiArrayView< DimNum, OtherElementType, bOtherIsChecked, bOtherIsRestrict, OtherSizeType > ... |
|||
TMultiArray
(
const TMultiArray< DimNum, OtherElementType, OtherAllocator, bOtherIsChecked >& Other |
Copy constructor with changed allocator. Use the common routine to perform the copy. | ||
TMultiArray
(
const TMultiArray& Other |
Copy constructor. Use the common routine to perform the copy. | ||
TMultiArray
(
TMultiArray&& Other |
Move constructor. | ||
TMultiArray
(
TMultiArray< DimNum, OtherElementType, OtherAllocator, bOtherIsChecked >&& Other |
Move constructor. | ||
TMultiArray
(
const ElementType* Ptr, |
Constructor from a raw array of elements. |
Destructors
| Type | Name | Description | |
|---|---|---|---|
~TMultiArray () |
Destructor. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| ElementType * | begin () |
DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support. | |
| void | Checks array invariants: if array size is greater than zero and less than maximum. | ||
| bool | Contains
(
const ComparisonType& Item |
Checks if this array contains the element. | |
| void | DimensionCheck
(
uint8 Dimension |
Checks if a dimension is within the allowed number of dimensions | |
| void | Empty () |
Empties the array. It calls the destructors on held items if needed. | |
| ElementType * | end () |
||
| TMultiArrayView< DimNum-1, ElementType, bIsChecked, bIsRestrict, SizeType > | Flatten
(
uint8 Dimension |
Flattens the array on a given dimension, merging that dimension and the following one. | |
| TMultiArrayView< DimNum-1, const ElementType, bIsChecked, bIsRestrict, SizeType > | Flatten () |
Flattens the array on a given dimension, merging that dimension and the following one. | |
| TMultiArrayView< DimNum-1, ElementType, bIsChecked, bIsRestrict, SizeType > | Flatten () |
Flattens the array on a given dimension, merging that dimension and the following one. | |
| TMultiArrayView< 1, const ElementType, bIsChecked, bIsRestrict, SizeType > | Flatten () |
Flattens the array view into a single dimension. | |
| TMultiArrayView< 1, ElementType, bIsChecked, bIsRestrict, SizeType > | Flatten () |
Flattens the array view into a single dimension. | |
| TMultiArrayView< DimNum-1, const ElementType, bIsChecked, bIsRestrict, SizeType > | Flatten
(
uint8 Dimension |
Flattens the array on a given dimension, merging that dimension and the following one. | |
| ElementAllocatorType & | |||
| const ElementAllocatorType & | |||
| const PointerType | GetData () |
Helper function for returning a typed pointer to the first array entry. | |
| PointerType | GetData () |
Helper function for returning a typed pointer to the first array entry. | |
| uint32 | GetTypeSize () |
Helper function returning the size of the inner type. | |
| bool | IsEmpty
(
uint8 Dimension |
Returns true if the dimension is empty and contains no elements. | |
| bool | IsEmpty () |
Returns true if the array is empty and contains no elements. | |
| SizeType | Num () |
Returns total number of elements | |
| SizeType | Num () |
Returns number of elements in a dimension. | |
| SizeType | Num
(
uint8 Dimension |
Returns number of elements in a dimension. | |
| void | RangeCheck
(
uint8 Dimension, |
Checks if index is in dimension range. | |
| SizeType | Rank () |
Returns number of dimensions. | |
| void | SetNum
(
TMultiArrayShape< DimNum, SizeType > NewShape |
Resizes array to given number of elements. | |
| void | SetNumUninitialized
(
TMultiArrayShape< DimNum, SizeType > NewShape |
Resizes array to given number of elements. New elements will be uninitialized. | |
| void | SetNumZeroed
(
TMultiArrayShape< DimNum, SizeType > NewShape |
Resizes array to given number of elements. New elements will be zeroed. | |
| TMultiArrayShape< DimNum, SizeType > | Shape () |
Returns the number of elements in each dimension. | |
| TMultiArrayView< DimNum, ElementType, bIsChecked, bIsRestrict, SizeType > | Returns a sliced view. Slicing outside of the range of the view is illegal. | ||
| TMultiArrayView< DimNum, const ElementType, bIsChecked, bIsRestrict, SizeType > | Returns a sliced view. Slicing outside of the range of the view is illegal. | ||
| void | SliceRangeCheck
(
uint8 Dimension, |
Checks if a slice range [Index, Index+InNum) is in dimension range. | |
| SizeType | Stride
(
uint8 Dimension |
Returns the stride for a dimension. |
Operators
| Type | Name | Description | |
|---|---|---|---|
| TMultiArrayView< DimNum-1, const ElementType, bIsChecked, bIsRestrict, SizeType > | operator[]
(
SizeType Index |
Array bracket operator. Returns reference to element at given index.Const version of the above. | |
| TMultiArrayView< DimNum-1, ElementType, bIsChecked, bIsRestrict, SizeType > | operator[]
(
SizeType Index |
Array bracket operator. Returns reference to element at given index. | |
| TMultiArray & | operator=
(
const TMultiArray< DimNum, ElementType, OtherAllocatorType, bOtherIsChecked >& Other |
Assignment operator. | |
| TMultiArray & | operator=
(
const TMultiArray& Other |
Assignment operator. | |
| TMultiArray & | operator=
(
const TMultiArrayView< DimNum, OtherElementType, bOtherIsChecked, bOtherIsRestrict, OtherSizeType > ... |
||
| TMultiArray & | operator=
(
TMultiArray&& Other |
Move assignment operator. |
Typedefs
| Name | Description |
|---|---|
| AllocatorType | |
| ElementAllocatorType | |
| ElementType | |
| PointerType | |
| SizeType |
Constants
| Name | Description |
|---|---|
| bIsChecked | |
| bIsRestrict | |
| DimNum |