![]() |
Murl Engine API
Version 2018.3
|
Sorting functions. More...
Classes | |
class | Murl::Util::CompareFunction< DataType > |
The compare functions. More... | |
Functions | |
template<class DataType > | |
void | Murl::Util::QuickSort (DataType *items, UInt32 numberOfItems, SInt32(*compareFunction)(const DataType *, const DataType *)) |
Quick sort items of specified type. More... | |
template<class DataType > | |
DataType * | Murl::Util::BinarySearch (const DataType *key, DataType *items, UInt32 numberOfItems, SInt32(*compareFunction)(const DataType *, const DataType *)) |
Binary search an item of specified type. More... | |
template<class DataType > | |
void | Murl::Util::BubbleSort (DataType *items, UInt32 numberOfItems, SInt32(*compareFunction)(const DataType *, const DataType *)) |
Bubble sort items of specified type. More... | |
template<class DataType > | |
void | Murl::Util::SortArray (Array< DataType > &array, SInt32(*compareFunction)(const DataType *, const DataType *)) |
Sort an array of specified type. More... | |
template<class DataType > | |
void | Murl::Util::SortArray (Array< DataType > &array, Bool ascending) |
Sort an array of specified type. More... | |
void | Murl::Util::SortUInt64Array (UInt64Array &array, Bool ascending) |
Sort a UInt64 array. More... | |
void | Murl::Util::SortSInt64Array (SInt64Array &array, Bool ascending) |
Sort a SInt64 array. More... | |
void | Murl::Util::SortUInt32Array (UInt32Array &array, Bool ascending) |
Sort a UInt32 array. More... | |
void | Murl::Util::SortSInt32Array (SInt32Array &array, Bool ascending) |
Sort a SInt32 array. More... | |
void | Murl::Util::SortRealArray (RealArray &array, Bool ascending) |
Sort a Real array. More... | |
void | Murl::Util::SortDoubleArray (DoubleArray &array, Bool ascending) |
Sort a Double array. More... | |
void | Murl::Util::SortStringArray (StringArray &array, Bool ascending) |
Sort a String array. More... | |
Sorting functions.
void Murl::Util::QuickSort | ( | DataType * | items, |
UInt32 | numberOfItems, | ||
SInt32(*)(const DataType *, const DataType *) | compareFunction | ||
) |
Quick sort items of specified type.
DataType | The type of item to sort. |
items | Pointer to the items to sort. |
numberOfItems | Number of items to sort. |
compareFunction | The compare function for the item, see CompareFunction::Ascending and Descending method. |
DataType* Murl::Util::BinarySearch | ( | const DataType * | key, |
DataType * | items, | ||
UInt32 | numberOfItems, | ||
SInt32(*)(const DataType *, const DataType *) | compareFunction | ||
) |
Binary search an item of specified type.
The items to search for are required to be sorted.
DataType | The type of item to sort. |
key | Pointer to the item to find. |
items | Pointer to the items to search for. |
numberOfItems | Number of items to search for. |
compareFunction | The compare function for the item, see CompareFunction::Ascending and Descending method. |
void Murl::Util::BubbleSort | ( | DataType * | items, |
UInt32 | numberOfItems, | ||
SInt32(*)(const DataType *, const DataType *) | compareFunction | ||
) |
Bubble sort items of specified type.
DataType | The type of item to sort. |
items | Pointer to the items to sort. |
numberOfItems | Number of items to sort. |
compareFunction | The compare function for the item, see CompareFunction::Ascending and Descending method. |
void Murl::Util::SortArray | ( | Array< DataType > & | array, |
SInt32(*)(const DataType *, const DataType *) | compareFunction | ||
) |
Sort an array of specified type.
The array is sorted by using the QuickSort algorithm and the compareFunction.
array | The array to sort. |
compareFunction | The compare function for the item, see CompareFunction::Ascending and Descending method. |
Sort an array of specified type.
The array is sorted by using the QuickSort algorithm and the CompareFunction class.
array | The array to sort. |
ascending | true for ascending sort order, false for descending sort order. |
void Murl::Util::SortUInt64Array | ( | UInt64Array & | array, |
Bool | ascending | ||
) |
Sort a UInt64 array.
The array is sorted by using the quick sort algorithm.
array | The array to sort. |
ascending | true for ascending sort order, false for descending sort order. |
void Murl::Util::SortSInt64Array | ( | SInt64Array & | array, |
Bool | ascending | ||
) |
Sort a SInt64 array.
The array is sorted by using the quick sort algorithm.
array | The array to sort. |
ascending | true for ascending sort order, false for descending sort order. |
void Murl::Util::SortUInt32Array | ( | UInt32Array & | array, |
Bool | ascending | ||
) |
Sort a UInt32 array.
The array is sorted by using the quick sort algorithm.
array | The array to sort. |
ascending | true for ascending sort order, false for descending sort order. |
void Murl::Util::SortSInt32Array | ( | SInt32Array & | array, |
Bool | ascending | ||
) |
Sort a SInt32 array.
The array is sorted by using the quick sort algorithm.
array | The array to sort. |
ascending | true for ascending sort order, false for descending sort order. |
Sort a Real array.
The array is sorted by using the quick sort algorithm.
array | The array to sort. |
ascending | true for ascending sort order, false for descending sort order. |
void Murl::Util::SortDoubleArray | ( | DoubleArray & | array, |
Bool | ascending | ||
) |
Sort a Double array.
The array is sorted by using the quick sort algorithm.
array | The array to sort. |
ascending | true for ascending sort order, false for descending sort order. |
void Murl::Util::SortStringArray | ( | StringArray & | array, |
Bool | ascending | ||
) |
Sort a String array.
The array is sorted by using the quick sort algorithm.
array | The array to sort. |
ascending | true for ascending sort order, false for descending sort order. |