Expand description
rdx
is a collection of generic algorithms and traits designed to make using radix sort easier
both for primitive and custom data types.
Radix sort has excellent performance characteristics, but has more requirements on the keys to be sorted, and hence is somewhat rarely used. The goal of this package is to provide easy-to-use radix sort implementations for a variety of types and to make it easy to implement radix sort for your own custom types.
Eventually, we plan to add a hybrid radix-comparison sort so as to allow obtaining the benefits
of radix sorts for compound types in general, even if all the components only satisfy Ord
.
Modules§
- american_
flag_ sort - An implementation of american flag sort
- float
- Utilities for radix-sorting floating point types
- ska_
sort - An implementation of ska sort, based off the code found in the blog post and on GitHub
- std_
impls RadixSortKey
implementations for standard-library types. Only included if thestd
feature is enabled.- util
- Various utilities for building radix sorts
Structs§
- Comparator
Sort - A comparator-based unordered sort on a type
- Default
Strategy - The default radix sort strategy for a type
- KeyBytes
Of - Get the key byte function associated with a given key extraction function
- KeyBytes
With - Implements
KeyBytes<K>
given a key length and a getter for key bytes - KeyStrategy
- A key-based unordered sort on a type
- Radix
Sort Strategy With - A radix sort strategy with a given byte extraction function and fallback sort
- TrySort
With - Treat a function as a try sort function. Assumes that:
true
is returned if and only if the input array is sorted The input array can be permuted arbitrarily, but no elements may be changed Ifforce
is true, then the input array must always be sorted
Constants§
- DEFAULT_
DELEGATION_ SIZE - Default maximum size to delegate array to standard sorting algorithm
- DEFAULT_
MAX_ DEPTH_ THRESHOLD - Default maximum depth threshold to force sorting algorithm switch (to avoid heap allocation)
Traits§
- Const
Radix Sort Key - A radix sort key known to have a constant key length
- KeyBytes
- A trait to get the bytes of a radix sort key
- KeyLength
- A radix sort key length function
- Radix
Sort Key - A key which can be used for radix sorts
- Radix
Sort Strategy - A strategy for radix sorting a type based off a given ordering
- TrySorter
- A sorting function for small arrays of a given type.
Functions§
- key_
strategy - Create a key-based unordered sorter on a type