Navigation
API > API/Plugins > API/Plugins/Learning
References
| Module | Learning |
| Header | /Engine/Plugins/Experimental/LearningAgents/Source/Learning/Public/LearningArray.h |
| Include | #include "LearningArray.h" |
Syntax
struct FIndexSet
Remarks
FIndexSet represents a set of indices - more specifically, either a slice of indices, or an ArrayView of int32 which acts as the set of indices. This type is generally used when we have allocated arrays of data but only need to iterate over or update a subset. For example, if we allocate data for 100 instances, but only 10 of those instances are active we can use an FIndexSet to indicate which ones.
Having this type act as either a slice or array of int32 lets us write code once, but still allows the compiler to potentially generate both code paths (or we can write both paths manually, using ispc to be more efficient when we have a slice and don't require random reads/writes).
We can also attempt to automatically convert index sets which contain consecutive indices from arrays of int32 to slices using the `TryMakeSlice_ function for more efficient processing.
Constructors
| Type | Name | Description | |
|---|---|---|---|
FIndexSet () |
|||
FIndexSet
(
const int32 InSingleIndex |
|||
FIndexSet
(
const TArrayView< const int32 > InIndices |
|||
FIndexSet
(
const TLearningArrayView< 1, const int32 > InIndices |
|||
FIndexSet
(
std::initializer_list< int32 > InIndices |
|||
FIndexSet
(
const TLearningArray< 1, int32, InAllocatorType >& InIndices |
|||
FIndexSet
(
const int32 InSliceStart, |
Functions
| Type | Name | Description | |
|---|---|---|---|
| FIndexSetIterator | begin () |
||
| bool | Contains
(
const int32 Index |
||
| FIndexSetIterator | end () |
||
| TLearningArrayView< 1, const int32 > | GetIndices () |
||
| int32 | GetSliceNum () |
||
| int32 | |||
| bool | IsSlice () |
||
| int32 | Num () |
||
| FIndexSet | Slice
(
const int32 InStart, |
||
| TArray< int32 > | ToArray () |
||
| bool | TryMakeSlice () |
Attempts to convert this IndexSet from a view of indices into a slice for more efficient processing. |
Operators
| Type | Name | Description | |
|---|---|---|---|
| int32 | operator[]
(
const int32 Index |
||
| FIndexSet & | |||
| FIndexSet & | operator=
(
const int32 InSingleIndex |
||
| FIndexSet & | operator=
(
const TArrayView< const int32 > InIndices |
||
| FIndexSet & | operator=
(
TLearningArrayView< 1, const int32 > InIndices |
||
| FIndexSet & | operator=
(
const TLearningArray< 1, int32, InAllocatorType >& InIndices |