Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
AlgoImpl Namespace Reference

Functions

template<typename T >
FORCEINLINE void Reverse (T *Array, int32 ArraySize)
 
template<typename RangeValueType , typename PredicateValueType , typename ProjectionType , typename SortPredicateType >
FORCEINLINE SIZE_T LowerBoundInternal (RangeValueType *First, const SIZE_T Num, const PredicateValueType &Value, ProjectionType Projection, SortPredicateType SortPredicate)
 
template<typename RangeValueType , typename PredicateValueType , typename ProjectionType , typename SortPredicateType >
FORCEINLINE SIZE_T UpperBoundInternal (RangeValueType *First, const SIZE_T Num, const PredicateValueType &Value, ProjectionType Projection, SortPredicateType SortPredicate)
 
template<typename T , typename ProjectionType , typename PredicateType >
void IntroSortInternal (T *First, SIZE_T Num, ProjectionType Projection, PredicateType Predicate)
 
FORCEINLINE int32 HeapGetLeftChildIndex (int32 Index)
 
FORCEINLINE bool HeapIsLeaf (int32 Index, int32 Count)
 
FORCEINLINE int32 HeapGetParentIndex (int32 Index)
 
template<typename RangeValueType , typename ProjectionType , typename PredicateType >
FORCEINLINE void HeapSiftDown (RangeValueType *Heap, int32 Index, const int32 Count, const ProjectionType &Projection, const PredicateType &Predicate)
 
template<class RangeValueType , typename ProjectionType , class PredicateType >
FORCEINLINE int32 HeapSiftUp (RangeValueType *Heap, int32 RootIndex, int32 NodeIndex, const ProjectionType &Projection, const PredicateType &Predicate)
 
template<typename RangeValueType , typename ProjectionType , typename PredicateType >
FORCEINLINE void HeapifyInternal (RangeValueType *First, SIZE_T Num, ProjectionType Projection, PredicateType Predicate)
 
template<typename RangeValueType , typename ProjectionType , class PredicateType >
void HeapSortInternal (RangeValueType *First, SIZE_T Num, ProjectionType Projection, PredicateType Predicate)
 

Function Documentation

◆ HeapGetLeftChildIndex()

FORCEINLINE int32 AlgoImpl::HeapGetLeftChildIndex ( int32 Index)

Gets the index of the left child of node at Index.

Parameters
IndexNode for which the left child index is to be returned.
Returns
Index of the left child.

Definition at line 16 of file BinaryHeap.h.

+ Here is the caller graph for this function:

◆ HeapGetParentIndex()

FORCEINLINE int32 AlgoImpl::HeapGetParentIndex ( int32 Index)

Gets the parent index for node at Index.

Parameters
Indexnode index.
Returns
Parent index.

Definition at line 38 of file BinaryHeap.h.

◆ HeapifyInternal()

template<typename RangeValueType , typename ProjectionType , typename PredicateType >
FORCEINLINE void AlgoImpl::HeapifyInternal ( RangeValueType * First,
SIZE_T Num,
ProjectionType Projection,
PredicateType Predicate )

Builds an implicit min-heap from a range of elements. This is the internal function used by Heapify overrides.

Parameters
Firstpointer to the first element to heapify
Numthe number of items to heapify
ProjectionThe projection to apply to the elements.
PredicateA binary predicate object used to specify if one element should precede another.

Definition at line 115 of file BinaryHeap.h.

◆ HeapIsLeaf()

FORCEINLINE bool AlgoImpl::HeapIsLeaf ( int32 Index,
int32 Count )

Checks if node located at Index is a leaf or not.

Parameters
IndexNode index.
Returns
true if node is a leaf, false otherwise.

Definition at line 27 of file BinaryHeap.h.

+ Here is the call graph for this function:

◆ HeapSiftDown()

template<typename RangeValueType , typename ProjectionType , typename PredicateType >
FORCEINLINE void AlgoImpl::HeapSiftDown ( RangeValueType * Heap,
int32 Index,
const int32 Count,
const ProjectionType & Projection,
const PredicateType & Predicate )

Fixes a possible violation of order property between node at Index and a child.

Parameters
HeapPointer to the first element of a binary heap.
IndexNode index.
CountSize of the heap.
ProjectionThe projection to apply to the elements.
PredicateA binary predicate object used to specify if one element should precede another.

Definition at line 53 of file BinaryHeap.h.

◆ HeapSiftUp()

template<class RangeValueType , typename ProjectionType , class PredicateType >
FORCEINLINE int32 AlgoImpl::HeapSiftUp ( RangeValueType * Heap,
int32 RootIndex,
int32 NodeIndex,
const ProjectionType & Projection,
const PredicateType & Predicate )

Fixes a possible violation of order property between node at NodeIndex and a parent.

Parameters
HeapPointer to the first element of a binary heap.
RootIndexHow far to go up?
NodeIndexNode index.
ProjectionThe projection to apply to the elements.
PredicateA binary predicate object used to specify if one element should precede another.
Returns
The new index of the node that was at NodeIndex

Definition at line 88 of file BinaryHeap.h.

◆ HeapSortInternal()

template<typename RangeValueType , typename ProjectionType , class PredicateType >
void AlgoImpl::HeapSortInternal ( RangeValueType * First,
SIZE_T Num,
ProjectionType Projection,
PredicateType Predicate )

Performs heap sort on the elements. This is the internal sorting function used by HeapSort overrides.

Parameters
Firstpointer to the first element to sort
Numthe number of elements to sort
Predicatepredicate class

Definition at line 132 of file BinaryHeap.h.

◆ IntroSortInternal()

template<typename T , typename ProjectionType , typename PredicateType >
void AlgoImpl::IntroSortInternal ( T * First,
SIZE_T Num,
ProjectionType Projection,
PredicateType Predicate )

Implementation of an introspective sort. Starts with quick sort and switches to heap sort when the iteration depth is too big. The sort is unstable, meaning that the ordering of equal items is not necessarily preserved. This is the internal sorting function used by IntroSort overrides.

Parameters
Firstpointer to the first element to sort
Numthe number of items to sort
ProjectionThe projection to sort by when applied to the element.
Predicatepredicate class

Definition at line 26 of file IntroSort.h.

◆ LowerBoundInternal()

template<typename RangeValueType , typename PredicateValueType , typename ProjectionType , typename SortPredicateType >
FORCEINLINE SIZE_T AlgoImpl::LowerBoundInternal ( RangeValueType * First,
const SIZE_T Num,
const PredicateValueType & Value,
ProjectionType Projection,
SortPredicateType SortPredicate )

Performs binary search, resulting in position of the first element >= Value

Parameters
FirstPointer to array
NumNumber of elements in array
ValueValue to look for
ProjectionCalled on values in array to get type that can be compared to Value
SortPredicatePredicate for sort comparison
Returns
Position of the first element >= Value, may be == Num

Definition at line 23 of file BinarySearch.h.

◆ Reverse()

template<typename T >
FORCEINLINE void AlgoImpl::Reverse ( T * Array,
int32 ArraySize )

Definition at line 10 of file Reverse.h.

◆ UpperBoundInternal()

template<typename RangeValueType , typename PredicateValueType , typename ProjectionType , typename SortPredicateType >
FORCEINLINE SIZE_T AlgoImpl::UpperBoundInternal ( RangeValueType * First,
const SIZE_T Num,
const PredicateValueType & Value,
ProjectionType Projection,
SortPredicateType SortPredicate )

Performs binary search, resulting in position of the first element that is larger than the given value

Parameters
FirstPointer to array
NumNumber of elements in array
ValueValue to look for
SortPredicatePredicate for sort comparison
Returns
Position of the first element > Value, may be == Num

Definition at line 56 of file BinarySearch.h.