![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include "CoreTypes.h"#include "Algo/BinarySearch.h"#include "Algo/Sort.h"#include "HAL/PlatformMath.h"#include "Templates/Less.h"Go to the source code of this file.
Classes | |
| struct | TDereferenceWrapper< T, PREDICATE_CLASS > |
| struct | TDereferenceWrapper< T *, PREDICATE_CLASS > |
| struct | TArrayRange< T > |
| struct | TIsContiguousContainer< TArrayRange< T > > |
| class | FEuclidDivisionGCD |
| class | TJugglingRotation< TGCDPolicy > |
| class | TRotationInPlaceMerge< TRotationPolicy > |
| class | TMergeSort< TMergePolicy, MinMergeSubgroupSize > |
| struct | TRadixSortKeyCastUint32< T > |
| struct | FRadixSortKeyFloat |
| struct | TRadixSortKeyCastUint64< T > |
Enumerations | |
| enum class | ERadixSortBufferState { IsInitialized , IsUninitialized } |
Functions | |
| template<class T , class PREDICATE_CLASS > | |
| void | Sort (T *First, const int32 Num, const PREDICATE_CLASS &Predicate) |
| template<class T , class PREDICATE_CLASS > | |
| void | Sort (T **First, const int32 Num, const PREDICATE_CLASS &Predicate) |
| template<class T > | |
| void | Sort (T *First, const int32 Num) |
| template<class T > | |
| void | Sort (T **First, const int32 Num) |
| template<class T , class PREDICATE_CLASS > | |
| void | Merge (T *Out, T *In, const int32 Mid, const int32 Num, const PREDICATE_CLASS &Predicate) |
| template<class T , class PREDICATE_CLASS > | |
| void | StableSortInternal (T *First, const int32 Num, const PREDICATE_CLASS &Predicate) |
| template<class T , class PREDICATE_CLASS > | |
| void | StableSort (T *First, const int32 Num, const PREDICATE_CLASS &Predicate) |
| template<class T , class PREDICATE_CLASS > | |
| void | StableSort (T **First, const int32 Num, const PREDICATE_CLASS &Predicate) |
| template<class T > | |
| void | StableSort (T *First, const int32 Num) |
| template<class T > | |
| void | StableSort (T **First, const int32 Num) |
| template<typename ValueType , typename CountType , class SortKeyClass > | |
| void | RadixSort32 (ValueType *RESTRICT Dst, ValueType *RESTRICT Src, CountType Num, const SortKeyClass &SortKey) |
| template<typename ValueType , typename CountType > | |
| void | RadixSort32 (ValueType *RESTRICT Dst, ValueType *RESTRICT Src, CountType Num) |
| template<typename CountType > | |
| void | RadixSort32 (float *RESTRICT Dst, float *RESTRICT Src, CountType Num) |
| template<ERadixSortBufferState BufferState, typename ValueType , typename CountType , class SortKeyClass > | |
| void | RadixSort64 (ValueType *RESTRICT Array, ValueType *RESTRICT Buffer, CountType Num, const SortKeyClass &SortKey) |
| template<ERadixSortBufferState BufferState, typename ValueType , typename CountType > | |
| void | RadixSort64 (ValueType *RESTRICT Array, ValueType *RESTRICT Buffer, CountType Num) |
| template<typename ValueType , typename CountType , class SortKeyClass > | |
| void | RadixSort64 (ValueType *RESTRICT Array, CountType Num, const SortKeyClass &SortKey) |
| template<typename ValueType , typename CountType > | |
| void | RadixSort64 (ValueType *RESTRICT Array, CountType Num) |
|
strong |
| void Merge | ( | T * | Out, |
| T * | In, | ||
| const int32 | Mid, | ||
| const int32 | Num, | ||
| const PREDICATE_CLASS & | Predicate | ||
| ) |
Stable merge to perform sort below. Stable sort is slower than non-stable algorithm.
| Out | Pointer to the first element of output array. |
| In | Pointer to the first element to sort. |
| Mid | Middle point of the table, i.e. merge separator. |
| Num | Number of elements in the whole table. |
| Predicate | Predicate class. |
| void RadixSort32 | ( | ValueType *RESTRICT | Dst, |
| ValueType *RESTRICT | Src, | ||
| CountType | Num, | ||
| const SortKeyClass & | SortKey | ||
| ) |
Very fast 32bit radix sort. SortKeyClass defines operator() that takes ValueType and returns a uint32. Sorting based on key. No comparisons. Is stable. Use a smaller CountType for smaller histograms.
| void RadixSort64 | ( | ValueType *RESTRICT | Array, |
| CountType | Num, | ||
| const SortKeyClass & | SortKey | ||
| ) |
| void RadixSort64 | ( | ValueType *RESTRICT | Array, |
| ValueType *RESTRICT | Buffer, | ||
| CountType | Num, | ||
| const SortKeyClass & | SortKey | ||
| ) |
Very fast 64bit radix sort. SortKeyClass defines operator() that takes ValueType and returns a uint32. Sorting based on key. No comparisons. Is stable. The default takes up 40k of stack space. Use a smaller CountType for smaller histograms and less stack space. Buffer needs to be able to hold at least Num elements.
Specialized version of the above Sort function for pointers to elements.
| First | pointer to the first element to sort |
| Num | the number of items to sort |
| void Sort | ( | T ** | First, |
| const int32 | Num, | ||
| const PREDICATE_CLASS & | Predicate | ||
| ) |
Specialized version of the above Sort function for pointers to elements.
| First | pointer to the first element to sort |
| Num | the number of items to sort |
| Predicate | predicate class |
Sort elements. The sort is unstable, meaning that the ordering of equal items is not necessarily preserved. Assumes < operator is defined for the template type.
| First | pointer to the first element to sort |
| Num | the number of items to sort |
| void Sort | ( | T * | First, |
| const int32 | Num, | ||
| const PREDICATE_CLASS & | Predicate | ||
| ) |
Sort elements using user defined predicate class. The sort is unstable, meaning that the ordering of equal items is not necessarily preserved.
| First | pointer to the first element to sort |
| Num | the number of items to sort |
| Predicate | predicate class |
Specialized version of the above StableSort function for pointers to elements. Stable sort is slower than non-stable algorithm.
| First | pointer to the first element to sort |
| Num | the number of items to sort |
| void StableSort | ( | T ** | First, |
| const int32 | Num, | ||
| const PREDICATE_CLASS & | Predicate | ||
| ) |
Specialized version of the above StableSort function for pointers to elements. Stable sort is slower than non-stable algorithm.
| First | pointer to the first element to sort |
| Num | the number of items to sort |
| Predicate | predicate class |
Stable sort elements. The sort is stable, meaning that the ordering of equal items is preserved, but it's slower than non-stable algorithm.
Assumes < operator is defined for the template type.
| First | pointer to the first element to sort |
| Num | the number of items to sort |
| void StableSort | ( | T * | First, |
| const int32 | Num, | ||
| const PREDICATE_CLASS & | Predicate | ||
| ) |
Stable sort elements using user defined predicate class. The sort is stable, meaning that the ordering of equal items is preserved, but it's slower than non-stable algorithm.
| First | pointer to the first element to sort |
| Num | the number of items to sort |
| Predicate | predicate class |
| void StableSortInternal | ( | T * | First, |
| const int32 | Num, | ||
| const PREDICATE_CLASS & | Predicate | ||
| ) |
Stable sort elements using user defined predicate class. The sort is stable, meaning that the ordering of equal items is preserved, but it's slower than non-stable algorithm.
This is the internal sorting function used by StableSort overrides.
| First | pointer to the first element to sort |
| Num | the number of items to sort |
| Predicate | predicate class |