![]() |
Public API Reference |
![]() |
A radix-sorter for signed and unsigned integers as well as floats. More...
#include <csutil/radixsort.h>
Public Member Functions | |
size_t * | GetRanks () const |
Get the last generated ranks array. | |
template<class T > | |
bool | Reorder (const T *source, T *dest, size_t size) |
Reorder a list with the ranks in-place. | |
template<class T > | |
void | ReorderInplace (T *source, size_t size) |
Reorder a list with the ranks in-place. | |
void | Sort (uint32 *array, size_t size) |
Sort array of unsigned integers. | |
void | Sort (int32 *array, size_t size) |
Sort array of signed integers. | |
void | Sort (float *array, size_t size) |
Sort array of floats. |
A radix-sorter for signed and unsigned integers as well as floats.
Creates an index-table instead of reordering elements. Based on ideas by Pierre Terdiman
Definition at line 40 of file radixsort.h.
size_t* csRadixSorter::GetRanks | ( | ) | const [inline] |
Get the last generated ranks array.
Definition at line 70 of file radixsort.h.
bool csRadixSorter::Reorder | ( | const T * | source, |
T * | dest, | ||
size_t | size | ||
) | [inline] |
Reorder a list with the ranks in-place.
Source and destination arrays should not overlap in memory!
Definition at line 119 of file radixsort.h.
void csRadixSorter::ReorderInplace | ( | T * | source, |
size_t | size | ||
) | [inline] |
Reorder a list with the ranks in-place.
Definition at line 79 of file radixsort.h.
void csRadixSorter::Sort | ( | uint32 * | array, |
size_t | size | ||
) |
Sort array of unsigned integers.
array | Array of integers to sort |
size | Number of elements in array |
void csRadixSorter::Sort | ( | int32 * | array, |
size_t | size | ||
) |
Sort array of signed integers.
array | Array of integers to sort |
size | Number of elements in array |
void csRadixSorter::Sort | ( | float * | array, |
size_t | size | ||
) |
Sort array of floats.
array | Array of floats to sort |
size | Number of elements in array |