|
libhatchet
|
Go to the source code of this file.
Classes | |
| class | hxradix_sort_key< key_t_, value_t_ > |
Typedefs | |
| using | hxradix_sort_key_void = hxradix_sort_key<uint32_t, void*> |
Functions | |
| void | hxradix_sort_void (hxradix_sort_key_void *begin_, hxradix_sort_key_void *end_, hxsystem_allocator_t allocator_) |
| void | hxradix_sort_void11 (hxradix_sort_key_void *begin_, hxradix_sort_key_void *end_, hxsystem_allocator_t allocator_) |
| template<typename key_t_, typename value_t_> | |
| void | hxradix_sort (hxradix_sort_key< key_t_, value_t_ > *begin_, hxradix_sort_key< key_t_, value_t_ > *end_, hxsystem_allocator_t allocator_) |
| template<typename key_t_, typename value_t_> | |
| void | hxradix_sort11 (hxradix_sort_key< key_t_, value_t_ > *begin_, hxradix_sort_key< key_t_, value_t_ > *end_, hxsystem_allocator_t allocator_) |
Θ(n) radix sort for 32-bit-or-smaller scalar keys.
| using hxradix_sort_key_void = hxradix_sort_key<uint32_t, void*> |
hxradix_sort_key_void - Internal.
Used to share the implementation with all pointer types.
| void hxradix_sort | ( | hxradix_sort_key< key_t_, value_t_ > * | begin_, |
| hxradix_sort_key< key_t_, value_t_ > * | end_, | ||
| hxsystem_allocator_t | allocator_ ) |
hxradix_sort - Sorts an array of hxradix_sort_key<key_t, value_t> by key_t using 8-bit digits.
key_t is the sort key and value_t the value being sorted. Keys of double, int64_t, and uint64_t are not supported. This is an Θ(n) algorithm that does not cause code bloat and is the fastest sorting algorithm available for scalar keys. Radix sort is best when you need real-time guarantees and have a massive workload. IBM used it to sort punch cards. hxradix_sort scales linearly with the byte-length of the key, whereas hxinsertion_sort is Θ(n) on mostly sorted data.
For example:
| void hxradix_sort11 | ( | hxradix_sort_key< key_t_, value_t_ > * | begin_, |
| hxradix_sort_key< key_t_, value_t_ > * | end_, | ||
| hxsystem_allocator_t | allocator_ ) |
hxradix_sort11 - Sorts an array of hxradix_sort_key<key_t, value_t> by key_t using 11-bit digits.
key_t is the sort key and value_t the value being sorted. Keys of double, int64_t, and uint64_t are not supported. hxradix_sort scales linearly with the byte-length of the key, whereas hxinsertion_sort is Θ(n) on mostly sorted data.
| void hxradix_sort_void | ( | hxradix_sort_key_void * | begin_, |
| hxradix_sort_key_void * | end_, | ||
| hxsystem_allocator_t | allocator_ ) |
hxradix_sort_void - Internal.
The shared implementation used with all pointer types when sorting using 8-bit digits.
| void hxradix_sort_void11 | ( | hxradix_sort_key_void * | begin_, |
| hxradix_sort_key_void * | end_, | ||
| hxsystem_allocator_t | allocator_ ) |
hxradix_sort_void11 - Internal.
The shared implementation used with all pointer types when sorting using 11-bit digits.