radix_sort.h
| File Path | engine/include/conjure/core/radix_sort.h |
| API ↗ | Strings and identifiers |
Stable least-significant-digit radix sort for unsigned keys with optional 32-bit payloads.
Functions
Public
radix_sort_u32
radix_sort_u32CONJURE_API void radix_sort_u32(
std::span<u32> keys,
std::span<u32> values,
std::span<u32> scratchKeys,
std::span<u32> scratchValues) noexcept;32-bit variant of radix_sort_u64 with payloads: four passes at most.
32-bit variant of radix_sort_u64 for keys only.
radix_sort_u64
radix_sort_u64CONJURE_API void radix_sort_u64(
std::span<u64> keys,
std::span<u32> values,
std::span<u64> scratchKeys,
std::span<u32> scratchValues) noexcept;Sorts keys ascending and permutes values alongside them. Stable. values must have the same size as keys, both scratch spans must be at least that large and no two of the four spans may overlap (all asserted; the input is left untouched on violation). On return the sorted data is in keys/values; the scratch contents are unspecified.
Sorts keys ascending. Stable. scratchKeys must be at least as large as keys and must not overlap it.