Navigation
API > API/Plugins > API/Plugins/Learning
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.
| Name | FIndexSet |
| Type | struct |
| Header File | /Engine/Plugins/Experimental/LearningAgents/Source/Learning/Public/LearningArray.h |
| Include Path | #include "LearningArray.h" |
Syntax
struct FIndexSet
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FIndexSet
(
const int32 InSliceStart, |
LearningArray.h | ||
FIndexSet
(
const TLearningArray< 1, int32, InAllocatorType >& InIndices |
LearningArray.h | ||
| LearningArray.h | |||
FIndexSet
(
std::initializer_list< int32 > InIndices |
LearningArray.h | ||
FIndexSet
(
const TLearningArrayView< 1, int32 > InIndices |
LearningArray.h | ||
FIndexSet
(
const TArrayView< int32 > InIndices |
LearningArray.h | ||
FIndexSet
(
const TLearningArrayView< 1, const int32 > InIndices |
LearningArray.h | ||
FIndexSet
(
const TArrayView< const int32 > InIndices |
LearningArray.h | ||
FIndexSet
(
const int32 InSingleIndex |
LearningArray.h | ||
FIndexSet () |
LearningArray.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Indices | TLearningArrayView< 1, const int32 > | LearningArray.h | ||
| SliceNum | int32 | LearningArray.h | ||
| SliceStart | int32 | LearningArray.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FIndexSetIterator begin() |
LearningArray.h | ||
bool Contains
(
const int32 Index |
LearningArray.h | ||
FIndexSetIterator end() |
LearningArray.h | ||
int32 Find
(
const int32 Index |
LearningArray.h | ||
TLearningArrayView< 1, const int32 > GetIndices() |
LearningArray.h | ||
int32 GetSliceNum() |
LearningArray.h | ||
int32 GetSliceStart() |
LearningArray.h | ||
bool IsSlice() |
LearningArray.h | ||
int32 Num() |
LearningArray.h | ||
FIndexSet Slice
(
const int32 InStart, |
LearningArray.h | ||
TArray< int32 > ToArray() |
LearningArray.h | ||
bool TryMakeSlice () |
Attempts to convert this IndexSet from a view of indices into a slice for more efficient processing. | LearningArray.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 operator[]
(
const int32 Index |
LearningArray.h | ||
| LearningArray.h | |||
FIndexSet & operator=
(
const TArrayView< const int32 > InIndices |
LearningArray.h | ||
| LearningArray.h | |||
| LearningArray.h | |||
| LearningArray.h |