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

Functions

template<typename T , int32 ArraySize>
FORCEINLINE void Reverse (T(&Array)[ArraySize])
 
template<typename T >
FORCEINLINE void Reverse (T *Array, int32 ArraySize)
 
template<typename ContainerType >
FORCEINLINE void Reverse (ContainerType &Container)
 
template<typename RangeType , typename ValueType , typename SortPredicateType >
FORCEINLINE int32 LowerBound (RangeType &Range, const ValueType &Value, SortPredicateType SortPredicate)
 
template<typename RangeType , typename ValueType >
FORCEINLINE int32 LowerBound (RangeType &Range, const ValueType &Value)
 
template<typename RangeType , typename ValueType , typename ProjectionType , typename SortPredicateType >
FORCEINLINE int32 LowerBoundBy (RangeType &Range, const ValueType &Value, ProjectionType Projection, SortPredicateType SortPredicate)
 
template<typename RangeType , typename ValueType , typename ProjectionType >
FORCEINLINE int32 LowerBoundBy (RangeType &Range, const ValueType &Value, ProjectionType Projection)
 
template<typename RangeType , typename ValueType , typename SortPredicateType >
FORCEINLINE int32 UpperBound (RangeType &Range, const ValueType &Value, SortPredicateType SortPredicate)
 
template<typename RangeType , typename ValueType >
FORCEINLINE int32 UpperBound (RangeType &Range, const ValueType &Value)
 
template<typename RangeType , typename ValueType , typename ProjectionType , typename SortPredicateType >
FORCEINLINE int32 UpperBoundBy (RangeType &Range, const ValueType &Value, ProjectionType Projection, SortPredicateType SortPredicate)
 
template<typename RangeType , typename ValueType , typename ProjectionType >
FORCEINLINE int32 UpperBoundBy (RangeType &Range, const ValueType &Value, ProjectionType Projection)
 
template<typename RangeType , typename ValueType , typename SortPredicateType >
FORCEINLINE int32 BinarySearch (RangeType &Range, const ValueType &Value, SortPredicateType SortPredicate)
 
template<typename RangeType , typename ValueType >
FORCEINLINE int32 BinarySearch (RangeType &Range, const ValueType &Value)
 
template<typename RangeType , typename ValueType , typename ProjectionType , typename SortPredicateType >
FORCEINLINE int32 BinarySearchBy (RangeType &Range, const ValueType &Value, ProjectionType Projection, SortPredicateType SortPredicate)
 
template<typename RangeType , typename ValueType , typename ProjectionType >
FORCEINLINE int32 BinarySearchBy (RangeType &Range, const ValueType &Value, ProjectionType Projection)
 
template<typename RangeType >
FORCEINLINE void Sort (RangeType &Range)
 
template<typename RangeType , typename PredicateType >
FORCEINLINE void Sort (RangeType &Range, PredicateType Pred)
 
template<typename RangeType , typename ProjectionType >
FORCEINLINE void SortBy (RangeType &Range, ProjectionType Proj)
 
template<typename RangeType , typename ProjectionType , typename PredicateType >
FORCEINLINE void SortBy (RangeType &Range, ProjectionType Proj, PredicateType Pred)
 
template<typename RangeType >
FORCEINLINE void IntroSort (RangeType &Range)
 
template<typename RangeType , typename PredicateType >
FORCEINLINE void IntroSort (RangeType &Range, PredicateType Predicate)
 
template<typename RangeType , typename ProjectionType >
FORCEINLINE void IntroSortBy (RangeType &Range, ProjectionType Projection)
 
template<typename RangeType , typename ProjectionType , typename PredicateType >
FORCEINLINE void IntroSortBy (RangeType &Range, ProjectionType Projection, PredicateType Predicate)
 

Function Documentation

◆ BinarySearch() [1/2]

template<typename RangeType , typename ValueType >
FORCEINLINE int32 Algo::BinarySearch ( RangeType & Range,
const ValueType & Value )

Definition at line 188 of file BinarySearch.h.

◆ BinarySearch() [2/2]

template<typename RangeType , typename ValueType , typename SortPredicateType >
FORCEINLINE int32 Algo::BinarySearch ( RangeType & Range,
const ValueType & Value,
SortPredicateType SortPredicate )

Returns index to the first found element matching a value in a range, the range must be sorted by <

Parameters
RangeThe range to search, must be already sorted by SortPredicate
ValueThe value to search for
SortPredicatePredicate for sort comparison, defaults to <
Returns
Index of found element, or INDEX_NONE

Definition at line 173 of file BinarySearch.h.

◆ BinarySearchBy() [1/2]

template<typename RangeType , typename ValueType , typename ProjectionType >
FORCEINLINE int32 Algo::BinarySearchBy ( RangeType & Range,
const ValueType & Value,
ProjectionType Projection )

Definition at line 218 of file BinarySearch.h.

◆ BinarySearchBy() [2/2]

template<typename RangeType , typename ValueType , typename ProjectionType , typename SortPredicateType >
FORCEINLINE int32 Algo::BinarySearchBy ( RangeType & Range,
const ValueType & Value,
ProjectionType Projection,
SortPredicateType SortPredicate )

Returns index to the first found element with projected value matching Value in a range, the range must be sorted by predicate

Parameters
RangeThe range to search, must be already sorted by SortPredicate
ValueThe value to search for
ProjectionFunctor or data member pointer, called via Invoke to compare to Value
SortPredicatePredicate for sort comparison, defaults to <
Returns
Index of found element, or INDEX_NONE

Definition at line 203 of file BinarySearch.h.

◆ IntroSort() [1/2]

template<typename RangeType >
FORCEINLINE void Algo::IntroSort ( RangeType & Range)

Sort a range of elements using its operator<. The sort is unstable.

Parameters
RangeThe range to sort.

Definition at line 137 of file IntroSort.h.

◆ IntroSort() [2/2]

template<typename RangeType , typename PredicateType >
FORCEINLINE void Algo::IntroSort ( RangeType & Range,
PredicateType Predicate )

Sort a range of elements using a user-defined predicate class. The sort is unstable.

Parameters
RangeThe range to sort.
PredicateA binary predicate object used to specify if one element should precede another.

Definition at line 149 of file IntroSort.h.

◆ IntroSortBy() [1/2]

template<typename RangeType , typename ProjectionType >
FORCEINLINE void Algo::IntroSortBy ( RangeType & Range,
ProjectionType Projection )

Sort a range of elements by a projection using the projection's operator<. The sort is unstable.

Parameters
RangeThe range to sort.
ProjectionThe projection to sort by when applied to the element.

Definition at line 161 of file IntroSort.h.

◆ IntroSortBy() [2/2]

template<typename RangeType , typename ProjectionType , typename PredicateType >
FORCEINLINE void Algo::IntroSortBy ( RangeType & Range,
ProjectionType Projection,
PredicateType Predicate )

Sort a range of elements by a projection using a user-defined predicate class. The sort is unstable.

Parameters
RangeThe range to sort.
ProjectionThe projection to sort by when applied to the element.
PredicateA binary predicate object, applied to the projection, used to specify if one element should precede another.

Definition at line 174 of file IntroSort.h.

◆ LowerBound() [1/2]

template<typename RangeType , typename ValueType >
FORCEINLINE int32 Algo::LowerBound ( RangeType & Range,
const ValueType & Value )

Definition at line 97 of file BinarySearch.h.

◆ LowerBound() [2/2]

template<typename RangeType , typename ValueType , typename SortPredicateType >
FORCEINLINE int32 Algo::LowerBound ( RangeType & Range,
const ValueType & Value,
SortPredicateType SortPredicate )

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

Parameters
RangeRange to search through, must be already sorted by SortPredicate
ValueValue to look for
SortPredicatePredicate for sort comparison, defaults to <
Returns
Position of the first element >= Value, may be position after last element in range

Definition at line 92 of file BinarySearch.h.

◆ LowerBoundBy() [1/2]

template<typename RangeType , typename ValueType , typename ProjectionType >
FORCEINLINE int32 Algo::LowerBoundBy ( RangeType & Range,
const ValueType & Value,
ProjectionType Projection )

Definition at line 118 of file BinarySearch.h.

◆ LowerBoundBy() [2/2]

template<typename RangeType , typename ValueType , typename ProjectionType , typename SortPredicateType >
FORCEINLINE int32 Algo::LowerBoundBy ( RangeType & Range,
const ValueType & Value,
ProjectionType Projection,
SortPredicateType SortPredicate )

Performs binary search, resulting in position of the first element with projected value >= Value using predicate

Parameters
RangeRange to search through, must be already sorted by SortPredicate
ValueValue to look for
ProjectionFunctor or data member pointer, called via Invoke to compare to Value
SortPredicatePredicate for sort comparison, defaults to <
Returns
Position of the first element >= Value, may be position after last element in range

Definition at line 113 of file BinarySearch.h.

◆ Reverse() [1/3]

template<typename ContainerType >
FORCEINLINE void Algo::Reverse ( ContainerType & Container)

Reverses a range

Parameters
ContainerThe container to reverse

Definition at line 50 of file Reverse.h.

◆ Reverse() [2/3]

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

Reverses a range

Parameters
ArrayA pointer to the array to reverse
ArraySizeThe number of elements in the array.

Definition at line 39 of file Reverse.h.

◆ Reverse() [3/3]

template<typename T , int32 ArraySize>
FORCEINLINE void Algo::Reverse ( T(&) Array[ArraySize])

Reverses a range

Parameters
ArrayThe array to reverse.

Definition at line 27 of file Reverse.h.

◆ Sort() [1/2]

template<typename RangeType >
FORCEINLINE void Algo::Sort ( RangeType & Range)

Sort a range of elements using its operator<. The sort is unstable.

Parameters
RangeThe range to sort.

Definition at line 16 of file Sort.h.

◆ Sort() [2/2]

template<typename RangeType , typename PredicateType >
FORCEINLINE void Algo::Sort ( RangeType & Range,
PredicateType Pred )

Sort a range of elements using a user-defined predicate class. The sort is unstable.

Parameters
RangeThe range to sort.
PredicateA binary predicate object used to specify if one element should precede another.

Definition at line 28 of file Sort.h.

◆ SortBy() [1/2]

template<typename RangeType , typename ProjectionType >
FORCEINLINE void Algo::SortBy ( RangeType & Range,
ProjectionType Proj )

Sort a range of elements by a projection using the projection's operator<. The sort is unstable.

Parameters
RangeThe range to sort.
ProjThe projection to sort by when applied to the element.

Definition at line 40 of file Sort.h.

◆ SortBy() [2/2]

template<typename RangeType , typename ProjectionType , typename PredicateType >
FORCEINLINE void Algo::SortBy ( RangeType & Range,
ProjectionType Proj,
PredicateType Pred )

Sort a range of elements by a projection using a user-defined predicate class. The sort is unstable.

Parameters
RangeThe range to sort.
ProjThe projection to sort by when applied to the element.
PredicateA binary predicate object, applied to the projection, used to specify if one element should precede another.

Definition at line 53 of file Sort.h.

◆ UpperBound() [1/2]

template<typename RangeType , typename ValueType >
FORCEINLINE int32 Algo::UpperBound ( RangeType & Range,
const ValueType & Value )

Definition at line 138 of file BinarySearch.h.

◆ UpperBound() [2/2]

template<typename RangeType , typename ValueType , typename SortPredicateType >
FORCEINLINE int32 Algo::UpperBound ( RangeType & Range,
const ValueType & Value,
SortPredicateType SortPredicate )

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

Parameters
RangeRange to search through, must be already sorted by SortPredicate
ValueValue to look for
SortPredicatePredicate for sort comparison, defaults to <
Returns
Position of the first element > Value, may be past end of range

Definition at line 133 of file BinarySearch.h.

◆ UpperBoundBy() [1/2]

template<typename RangeType , typename ValueType , typename ProjectionType >
FORCEINLINE int32 Algo::UpperBoundBy ( RangeType & Range,
const ValueType & Value,
ProjectionType Projection )

Definition at line 159 of file BinarySearch.h.

◆ UpperBoundBy() [2/2]

template<typename RangeType , typename ValueType , typename ProjectionType , typename SortPredicateType >
FORCEINLINE int32 Algo::UpperBoundBy ( RangeType & Range,
const ValueType & Value,
ProjectionType Projection,
SortPredicateType SortPredicate )

Performs binary search, resulting in position of the first element with projected value > Value using predicate

Parameters
RangeRange to search through, must be already sorted by SortPredicate
ValueValue to look for
ProjectionFunctor or data member pointer, called via Invoke to compare to Value
SortPredicatePredicate for sort comparison, defaults to <
Returns
Position of the first element > Value, may be past end of range

Definition at line 154 of file BinarySearch.h.