Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
Sorting.h File Reference
+ Include dependency graph for Sorting.h:
+ This graph shows which files directly or indirectly include this file:

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 >
 

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)
 

Function Documentation

◆ Merge()

template<class T , class PREDICATE_CLASS >
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.

Parameters
OutPointer to the first element of output array.
InPointer to the first element to sort.
MidMiddle point of the table, i.e. merge separator.
NumNumber of elements in the whole table.
PredicatePredicate class.

Definition at line 134 of file Sorting.h.

◆ Sort() [1/4]

template<class T >
void Sort ( T ** First,
const int32 Num )

Specialized version of the above Sort function for pointers to elements.

Parameters
Firstpointer to the first element to sort
Numthe number of items to sort

Definition at line 117 of file Sorting.h.

◆ Sort() [2/4]

template<class T , class PREDICATE_CLASS >
void Sort ( T ** First,
const int32 Num,
const PREDICATE_CLASS & Predicate )

Specialized version of the above Sort function for pointers to elements.

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

Definition at line 90 of file Sorting.h.

◆ Sort() [3/4]

template<class T >
void Sort ( T * First,
const int32 Num )

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.

Parameters
Firstpointer to the first element to sort
Numthe number of items to sort

Definition at line 104 of file Sorting.h.

◆ Sort() [4/4]

template<class T , class PREDICATE_CLASS >
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.

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

Definition at line 76 of file Sorting.h.

◆ StableSort() [1/4]

template<class T >
void StableSort ( T ** First,
const int32 Num )

Specialized version of the above StableSort function for pointers to elements. Stable sort is slower than non-stable algorithm.

Parameters
Firstpointer to the first element to sort
Numthe number of items to sort

Definition at line 413 of file Sorting.h.

◆ StableSort() [2/4]

template<class T , class PREDICATE_CLASS >
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.

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

Definition at line 385 of file Sorting.h.

◆ StableSort() [3/4]

template<class T >
void StableSort ( T * First,
const int32 Num )

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.

Parameters
Firstpointer to the first element to sort
Numthe number of items to sort

Definition at line 400 of file Sorting.h.

◆ StableSort() [4/4]

template<class T , class PREDICATE_CLASS >
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.

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

Definition at line 371 of file Sorting.h.

◆ StableSortInternal()

template<class T , class 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.

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

Definition at line 356 of file Sorting.h.