Struct timely_sort::LSBSWCRadixSorter
[−]
[src]
pub struct LSBSWCRadixSorter<T> { /* fields omitted */ }
A few buffers capable of radix sorting by least significant byte.
The sorter allows the use of multiple different key bytes, determined by a type U: Unsigned
.
Currently, one is allowed to mix and match these as records are pushed, which may be a design
bug.
Methods
impl<T> RadixSorter<T>
[src]
fn new() -> RadixSorter<T>
Constructs a new radix sorter.
fn extend<U: Unsigned, F: Fn(&T) -> U, I: Iterator<Item=T>>(&mut self,
iterator: I,
function: &F)
iterator: I,
function: &F)
Pushes a sequence of elements into the sorter.
fn push<U: Unsigned, F: Fn(&T) -> U>(&mut self, element: T, function: &F)
Pushes a single element into the sorter.
fn push_batch<U: Unsigned, F: Fn(&T) -> U>(&mut self,
batch: Vec<T>,
function: &F)
batch: Vec<T>,
function: &F)
Pushes a batch of elements into the sorter, and transfers ownership of the containing allocation.
fn sort<U: Unsigned, F: Fn(&T) -> U>(&mut self,
batches: &mut Vec<Vec<T>>,
function: &F)
batches: &mut Vec<Vec<T>>,
function: &F)
Sorts a sequence of batches, re-using the allocations where possible and re-populating batches
.
fn finish<U: Unsigned, F: Fn(&T) -> U>(&mut self, function: &F) -> Vec<Vec<T>>
Finishes a sorting session by allocating and populating a sequence of batches.
fn finish_into<U: Unsigned, F: Fn(&T) -> U>(&mut self,
target: &mut Vec<Vec<T>>,
function: &F)
target: &mut Vec<Vec<T>>,
function: &F)
Finishes a sorting session by populating a supplied sequence.
fn recycle(&mut self, buffers: &mut Vec<Vec<T>>)
Consumes supplied buffers for future re-use by the sorter.
This method is equivalent to self.rebalance(buffers, usize::max_value())
.
fn rebalance(&mut self, buffers: &mut Vec<Vec<T>>, intended: usize)
Either consumes from or pushes into buffers
to leave intended
spare buffers with the sorter.