Algo

Choose your operating system:

Windows

macOS

Linux

Filters

Classes

Name

Description

Public struct

FKahnContext

Some variables shared with subfunctions

Public struct

TLess

Public struct

TPlus

TPlus specifically takes const T& and returns T.

Typedefs

Name

Description

FKahnHandle

KahnTopologicalSort converts vertices and edges from ElementType to indexes of the vertex in the original UniqueRange of ElementType.

Enums

Name

Description

Public enum

Algo::ENoRef

A special enum indicating that reference should NOT be used when iterating a container.

Public enum

Algo::ETopologicalSort

Flags for behavior of TopologicalSort; see the function comment in TopologicalSort.h

Functions

Name Description

Public function

T

 

Algo::Accumulate

(
    const A& Input,
    T Init,
    OpT Op
)

Sums a range by successively applying Op.

Public function

T

 

Algo::Accumulate

(
    const A& Input,
    T Init
)

Sums a range.

Public function

bool

 

Algo::AllOf

(
    const RangeType& Range,
    ProjectionType Projection
)

Checks if every projection of the elements in the range is truthy.

Public function

bool

 

Algo::AllOf

(
    const RangeType& Range
)

Checks if every element in the range is truthy.

Public function

bool

 

Algo::AnyOf

(
    const RangeType& Range,
    ProjectionType Projection
)

Checks if any projection of the elements in the range is truthy.

Public function

bool

 

Algo::AnyOf

(
    const RangeType& Range,
    ProjectionType Projection,
    ENoRef NoRef
)

Checks if any projection of the elements in the range is truthy.

Public function

bool

 

Algo::AnyOf

(
    const RangeType& Range
)

Checks if any element in the range is truthy.

Public function

auto

 

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 <

Public function

auto

 

Algo::BinarySearch

(
    RangeType& Range,
    const ValueType& Value
)

Public function

auto

 

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

Public function

auto

 

Algo::BinarySearchBy

(
    RangeType& Range,
    const ValueType& Value,
    ProjectionType Projection
)

Public function

constexpr bo...

 

Algo::Compare

(
    InAT&& InputA,
    InBT&& InputB
)

Compares two contiguous containers using operator== to compare pairs of elements.

Public function

constexpr bo...

 

Algo::CompareByPredicate

(
    InAT&& InputA,
    InBT&& InputB,
    PredicateT Predicate
)

Compares two contiguous containers using a predicate to compare pairs of elements.

Public function

void

 

Algo::Copy

(
    const InT& Input,
    OutT& Output
)

Copies a range into a container

Public function

void

 

Algo::Copy

(
    const InT& Input,
    OutT& Output,
    ENoRef NoRef
)

Copies a range into a container.

Public function

void

 

Algo::CopyIf

(
    const InT& Input,
    OutT& Output,
    PredicateT Predicate
)

Conditionally copies a range into a container

Public function

SIZE_T

 

Algo::Count

(
    const InT& Input,
    const ValueT& InValue
)

Counts elements of a range that equal the supplied value

Public function

SIZE_T

 

Algo::CountIf

(
    const InT& Input,
    PredicateT Predicate
)

Counts elements of a range that match a given predicate

Public function

auto

 

Algo::Find

(
    RangeType&& Range,
    const ValueType& Value
)

Returns a pointer to the first element in the range which is equal to the given value.

Public function

auto

 

Algo::FindBy

(
    RangeType&& Range,
    const ValueType& Value,
    ProjectionType Proj
)

Returns a pointer to the first element in the range whose projection is equal to the given value.

Public function

auto

 

Algo::FindByPredicate

(
    RangeType&& Range,
    PredicateType Pred
)

Returns a pointer to the first element in the range which matches the predicate.

Public function

auto

 

Algo::FindLast

(
    RangeType&& Range,
    const ValueType& Value
)

Returns a pointer to the last element in the range which is equal to the given value.

Public function

auto

 

Algo::FindLastBy

(
    RangeType&& Range,
    const ValueType& Value,
    ProjectionType Proj
)

Returns a pointer to the last element in the range whose projection is equal to the given value.

Public function

auto

 

Algo::FindLastByPredicate

(
    RangeType&& Range,
    PredicateType Pred
)

Returns a pointer to the last element in the range which matches the predicate.

Public function

auto

 

Algo::FindSequence

(
    const RangeWhereType& Where,
    const RangeWhatType& What
)

Searches for the first occurrence of a sequence of elements in another sequence.

Public function

int32

 

Algo::FindSortedStringCaseInsensitive

(
    const TCHAR* Str,
    const TCHAR*const (&) SortedAr...
)

Finds a string in an array of sorted strings, by case-insensitive search, by using binary subdivision of the array.

Public function

void

 

Algo::ForEach

(
    InT& Input,
    CallableT Callable
)

Invokes a callable to each element in a range

Public function

void

 

Algo::ForEachIf

(
    InT& Input,
    PredicateT Predicate,
    CallableT Callable
)

Conditionally invokes a callable to each element in a range

Public function

void

 

Algo::Heapify

(
    RangeType& Range,
    PredicateType Predicate
)

Builds an implicit min-heap from a range of elements.

Public function

void

 

Algo::Heapify

(
    RangeType& Range
)

Builds an implicit min-heap from a range of elements.

Public function

void

 

Algo::HeapifyBy

(
    RangeType& Range,
    ProjectionType Projection,
    PredicateType Predicate
)

Builds an implicit min-heap from a range of elements.

Public function

void

 

Algo::HeapifyBy

(
    RangeType& Range,
    ProjectionType Projection
)

Builds an implicit min-heap from a range of elements.

Public function

void

 

Algo::HeapSort

(
    RangeType&& Range,
    PredicateType Predicate
)

Performs heap sort on the elements.

Public function

void

 

Algo::HeapSort

(
    RangeType&& Range
)

Performs heap sort on the elements. Assumes < operator is defined for the element type.

Public function

void

 

Algo::HeapSortBy

(
    RangeType&& Range,
    ProjectionType Projection
)

Performs heap sort on the elements. Assumes < operator is defined for the projected element type.

Public function

void

 

Algo::HeapSortBy

(
    RangeType&& Range,
    ProjectionType Projection,
    PredicateType Predicate
)

Performs heap sort on the elements.

Public function

auto

 

Algo::IndexOf

(
    RangeType&& Range,
    const ValueType& Value
)

Returns the index of the first element in the range which is equal to the given value.

Public function

auto

 

Algo::IndexOfBy

(
    RangeType&& Range,
    const ValueType& Value,
    ProjectionType Proj
)

Returns the index of the first element in the range whose projection is equal to the given value.

Public function

auto

 

Algo::IndexOfByPredicate

(
    RangeType&& Range,
    PredicateType Pred
)

Returns the index of the first element in the range which matches the predicate.

Public function

void

 

Algo::IntroSort

(
    RangeType&& Range
)

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

Public function

void

 

Algo::IntroSort

(
    RangeType&& Range,
    PredicateType Predicate
)

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

Public function

void

 

Algo::IntroSortBy

(
    RangeType&& Range,
    ProjectionType Projection
)

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

Public function

void

 

Algo::IntroSortBy

(
    RangeType&& Range,
    ProjectionType Projection,
    PredicateType Predicate
)

Sort a range of elements by a projection using a user-defined predicate class.

Public function

bool

 

Algo::IsHeap

(
    RangeType& Range
)

Verifies that the range is a min-heap (parent <= child).

Public function

bool

 

Algo::IsHeap

(
    RangeType& Range,
    PredicateType Predicate
)

Verifies that the range is a min-heap (parent <= child)

Public function

bool

 

Algo::IsHeapBy

(
    RangeType& Range,
    ProjectionType Projection
)

Verifies that the range is a min-heap (parent <= child).

Public function

bool

 

Algo::IsHeapBy

(
    RangeType& Range,
    ProjectionType Projection,
    PredicateType Predicate
)

Verifies that the range is a min-heap (parent <= child)

Public function

bool

 

Algo::IsSorted

(
    const T* Array,
    int32 ArraySize,
    PredType Pred
)

IsSorted taking a pointer and size has been deprecated - please pass a TArrayView instead

Public function

bool

 

Algo::IsSorted

(
    const RangeType& Range,
    PredType Pred
)

Tests if a range is sorted by a user-defined predicate.

Public function

bool

 

Algo::IsSorted

(
    const T* Array,
    int32 ArraySize
)

IsSorted taking a pointer and size has been deprecated - please pass a TArrayView instead

Public function

bool

 

Algo::IsSorted

(
    const RangeType& Range
)

Tests if a range is sorted by its element type's operator<.

Public function

bool

 

Algo::IsSortedBy

(
    const RangeType& Range,
    ProjectionType Projection
)

Tests if a range is sorted by a projection of the element type, using the projection's operator<.

Public function

bool

 

Algo::IsSortedBy

(
    const RangeType& Range,
    ProjectionType Projection,
    PredType Pred
)

Tests if a range is sorted by a projection of the element type, using a user-defined predicate on the projection.

Public function

bool

 

Algo::KahnTopologicalSort

(
    RangeType& UniqueRange,
    GetElementDependenciesType GetEleme...,
    ETopologicalSort Flags
)

Public entrypoint.

Public function

void

 

Algo::LegacySort

(
    RangeType&& Range
)

Sort a range of elements using its operator<.

Public function

void

 

Algo::LegacySort

(
    RangeType&& Range,
    PredicateType Pred
)

Sort a range of elements using a user-defined predicate class.

Public function

void

 

Algo::LegacySortBy

(
    RangeType&& Range,
    ProjectionType Proj
)

Sort a range of elements by a projection using the projection's operator<.

Public function

void

 

Algo::LegacySortBy

(
    RangeType&& Range,
    ProjectionType Proj,
    PredicateType Pred
)

Sort a range of elements by a projection using a user-defined predicate class.

Public function

int32

 

Algo::LevenshteinDistance

(
    const RangeAType& RangeA,
    const RangeBType& RangeB
)

LevenshteinDistance return the number of edit operation we need to transform RangeA to RangeB.

Public function

auto

 

Algo::LowerBound

(
    RangeType& Range,
    const ValueType& Value
)

Public function

auto

 

Algo::LowerBound

(
    RangeType& Range,
    const ValueType& Value,
    SortPredicateType SortPredicate
)

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

Public function

auto

 

Algo::LowerBoundBy

(
    RangeType& Range,
    const ValueType& Value,
    ProjectionType Projection
)

Public function

auto

 

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

Public function

auto

 

Algo::MaxElement

(
    RangeType& Range
)

Returns a pointer to the maximum element in a range.

Public function

auto

 

Algo::MaxElement

(
    RangeType& Range,
    ComparatorType Comp
)

Returns a pointer to the maximum element in a range with a user-defined binary comparator.

Public function

auto

 

Algo::MaxElementBy

(
    RangeType& Range,
    ProjectionType Proj
)

Returns a pointer to the maximum element in a range with a user-defined binary comparator.

Public function

auto

 

Algo::MaxElementBy

(
    RangeType& Range,
    ProjectionType Proj,
    ComparatorType Comp
)

Returns a pointer to the maximum element in a range with a user-defined binary comparator.

Public function

auto

 

Algo::MinElement

(
    RangeType& Range,
    ComparatorType Comp
)

Returns a pointer to the minimum element in a range with a user-defined binary comparator.

Public function

auto

 

Algo::MinElement

(
    RangeType& Range
)

Returns a pointer to the minimum element in a range.

Public function

auto

 

Algo::MinElementBy

(
    RangeType& Range,
    ProjectionType Proj
)

Returns a pointer to the minimum element in a range with a user-defined binary comparator.

Public function

auto

 

Algo::MinElementBy

(
    RangeType& Range,
    ProjectionType Proj,
    ComparatorType Comp
)

Returns a pointer to the minimum element in a range with a user-defined binary comparator.

Public function

bool

 

Algo::NoneOf

(
    const RangeType& Range,
    ProjectionType Projection,
    ENoRef NoRef
)

Checks if no projection of the elements in the range is truthy.

Public function

bool

 

Algo::NoneOf

(
    const RangeType& Range,
    ProjectionType Projection
)

Checks if no projection of the elements in the range is truthy.

Public function

bool

 

Algo::NoneOf

(
    const RangeType& Range
)

Checks if no element in the range is truthy.

Public function

constexpr bo...

 

Algo::operator!

(
    ETopologicalSort E
)

Public function

constexpr ET...

 

Algo::operator&

(
    ETopologicalSort Lhs,
    ETopologicalSort Rhs
)

Public function

ETopological...

 

Algo::operator&=

(
    ETopologicalSort& Lhs,
    ETopologicalSort Rhs
)

Public function

constexpr ET...

 

Algo::operator^

(
    ETopologicalSort Lhs,
    ETopologicalSort Rhs
)

Public function

ETopological...

 

Algo::operator^=

(
    ETopologicalSort& Lhs,
    ETopologicalSort Rhs
)

Public function

constexpr ET...

 

Algo::operator|

(
    ETopologicalSort Lhs,
    ETopologicalSort Rhs
)

Public function

ETopological...

 

Algo::operator|=

(
    ETopologicalSort& Lhs,
    ETopologicalSort Rhs
)

Public function

constexpr ET...

 

Algo::operator~

(
    ETopologicalSort E
)

Public function

IndexType

 

Algo::Partition

(
    T* Elements,
    const IndexType Num,
    const UnaryPredicate& Predicate
)

Rearranges the elements so that all the elements for which Predicate returns true precede all those for which it returns false.

Public function

void

 

Algo::RandomShuffle

(
    RangeType& Range
)

Randomly shuffle a range of elements.

Public function

int32

 

Algo::RemoveIf

(
    RangeType& Range,
    Predicate Pred
)

Moves all elements which do not match the predicate to the front of the range, while leaving all other elements is a constructed but unspecified state.

Public function

void

 

Algo::Replace

(
    RangeType&& Range,
    const ValueType& InOld,
    const ValueType& InNew
)

Replaces all elements that compare equal to one value with a new value.

Public function

void

 

Algo::ReplaceIf

(
    RangeType&& Range,
    PredicateType InPred,
    const ValueType& InNew
)

Replaces all elements that satisfy the predicate with the given value.

Public function

void

 

Algo::Reverse

(
    T(&) Array
)

Reverses a range

Public function

void

 

Algo::Reverse

(
    ContainerType& Container
)

Reverses a range

Public function

void

 

Algo::Reverse

(
    T* Array,
    int32 ArraySize
)

Reverses a range

Public function

int32

 

Algo::Rotate

(
    RangeType& Range,
    int32 Count
)

Rotates a given amount of elements from the front of the range to the end of the range.

Public function

auto

 

Algo::SelectRandomWeightedBy

(
    RangeType&& Range,
    ProjectionType Proj
)

Randomly select an element from a range of elements, weighted by a projection.

Public function

void

 

Algo::Sort

(
    RangeType&& Range,
    PredicateType Pred
)

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

Public function

void

 

Algo::Sort

(
    RangeType&& Range
)

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

Public function

void

 

Algo::SortBy

(
    RangeType&& Range,
    ProjectionType Proj,
    PredicateType Pred
)

Sort a range of elements by a projection using a user-defined predicate class.

Public function

void

 

Algo::SortBy

(
    RangeType&& Range,
    ProjectionType Proj
)

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

Public function

int32

 

Algo::StableRemoveIf

(
    RangeType& Range,
    Predicate Pred
)

Moves all elements which do not match the predicate to the front of the range, while leaving all other elements is a constructed but unspecified state.

Public function

void

 

Algo::StableSort

(
    RangeType&& Range
)

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

Public function

void

 

Algo::StableSort

(
    RangeType&& Range,
    PredicateType Pred
)

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

Public function

void

 

Algo::StableSortBy

(
    RangeType&& Range,
    ProjectionType Proj
)

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

Public function

void

 

Algo::StableSortBy

(
    RangeType&& Range,
    ProjectionType Proj,
    PredicateType Pred
)

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

Public function

void

 

Algo::Transform

(
    const InT& Input,
    OutT& Output,
    TransformT Trans
)

Applies a transform to a range and stores the results into a container

Public function

T

 

Algo::TransformAccumulate

(
    const A& Input,
    MapT MapOp,
    T Init
)

Sums a range by applying MapOp to each element, and then summing the results.

Public function

T

 

Algo::TransformAccumulate

(
    const A& Input,
    MapT MapOp,
    T Init,
    OpT Op
)

Sums a range by applying MapOp to each element, and then summing the results.

Public function

void

 

Algo::TransformIf

(
    const InT& Input,
    OutT& Output,
    PredicateT Predicate,
    TransformT Trans
)

Conditionally applies a transform to a range and stores the results into a container

Public function

auto

 

Algo::Unique

(
    RangeType&& Range,
    BinaryPredicate Predicate
)

Public function

auto

 

Algo::Unique

(
    RangeType&& Range
)

Eliminates all but the first element from every consecutive group of equivalent elements and returns past-the-end index of unique elements for the new logical end of the range.

Public function

auto

 

Algo::UpperBound

(
    RangeType& Range,
    const ValueType& Value
)

Public function

auto

 

Algo::UpperBound

(
    RangeType& Range,
    const ValueType& Value,
    SortPredicateType SortPredicate
)

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

Public function

auto

 

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

Public function

auto

 

Algo::UpperBoundBy

(
    RangeType& Range,
    const ValueType& Value,
    ProjectionType Projection
)

Public function

TRangePointe...

 

AlgoImpl::FindBy

(
    RangeType&& Range,
    const ValueType& Value,
    ProjectionType Proj
)

Public function

TRangePointe...

 

AlgoImpl::FindByPredicate

(
    RangeType&& Range,
    PredicateType Pred
)

Public function

T *

 

AlgoImpl::FindLastBy

(
    T* First,
    SIZE_T Num,
    const ValueType& Value,
    ProjectionType Proj
)

Public function

T *

 

AlgoImpl::FindLastByPredicate

(
    T* First,
    SIZE_T Num,
    PredicateType Pred
)

Public function

constexpr Wh...

 

AlgoImpl::FindSequence

(
    WhereType* First,
    WhereType* Last,
    WhatType* WhatFirst,
    WhatType* WhatLast
)

Public function

auto

 

AlgoImpl::IndexOfBy

(
    RangeType&& Range,
    const ValueType& Value,
    ProjectionType Proj
)

Public function

auto

 

AlgoImpl::IndexOfByPredicate

(
    RangeType&& Range,
    PredicateType Pred
)

Public function

void

 

AlgoImpl::IntroSortInternal

(
    T* First,
    IndexType Num,
    ProjectionType Projection,
    PredicateType Predicate
)

Implementation of an introspective sort.

Public function

bool

 

AlgoImpl::IsHeapInternal

(
    RangeValueType* Heap,
    IndexType Num,
    ProjectionType Projection,
    PredicateType Predicate
)

Verifies that the range is a min-heap (parent <= child) This is the internal function used by IsHeap overrides.

Public function

bool

 

AlgoImpl::IsSortedBy

(
    const T* Range,
    IndexType RangeSize,
    ProjectionType Proj,
    PredType Pred
)

Public function

void

 

AlgoImpl::KahnTopologicalSort_CreateWorkingGraph

(
    FKahnContext& Context,
    RangeType& UniqueRange,
    GetElementDependenciesType GetEleme...,
    TSet< FKahnHandle >& OutInitialInd...
)

Helper functions.

Public function

FKahnHandle

 

AlgoImpl::KahnTopologicalSort_PickMinimumCycleVertex

(
    FKahnContext& Context
)

Called when there is a cycle (aka no vertices are independent).

Public function

void

 

AlgoImpl::LegacySortInternal

(
    T* First,
    int32 Num,
    ProjectionType Projection,
    PredicateType Predicate
)

Sort elements using user defined predicate class.

Public function

SizeType

 

AlgoImpl::LowerBoundInternal

(
    RangeValueType* First,
    const SizeType Num,
    const PredicateValueType& Value,
    ProjectionType Projection,
    SortPredicateType SortPredicate
)

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

Public function

TRangePointe...

 

AlgoImpl::MaxElementBy

(
    RangeType& Range,
    ProjectionType Proj,
    PredicateType Pred
)

Public function

void

 

AlgoImpl::Merge

(
    T* First,
    int32 Mid,
    int32 Num,
    ProjectionType Projection,
    PredicateType Predicate
)

Public function

TRangePointe...

 

AlgoImpl::MinElementBy

(
    RangeType& Range,
    ProjectionType Proj,
    PredicateType Pred
)

Public function

void

 

AlgoImpl::Reverse

(
    T* Array,
    int32 ArraySize
)

Public function

int32

 

AlgoImpl::RotateInternal

(
    T* First,
    int32 Num,
    int32 Count
)

Public function

TRangePointe...

 

AlgoImpl::SelectRandomWeightedBy

(
    RangeType&& Range,
    ProjectionType Proj
)

Public function

void

 

AlgoImpl::StableSortInternal

(
    T* First,
    int32 Num,
    ProjectionType Projection,
    PredicateType Predicate
)

Sort elements using user defined projection and predicate classes.

Public function

SizeType

 

AlgoImpl::Unique

(
    T* Array,
    SizeType ArraySize,
    BinaryPredicate Predicate
)

Public function

SizeType

 

AlgoImpl::UpperBoundInternal

(
    RangeValueType* First,
    const SizeType 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

Variables

Name Description

Public variable

constexpr int32

 

MinMergeSubgroupSize

Public variable

const RangeType...

 

present

Sorts the given range in leaf to root order.

Public variable

const RangeType...

 

succeeded

Public variable

const RangeType...

 

TopologicalSort