pub struct DaryHeapU32 {
root: u32,
blocks: Vec<HeapBlock<u32, 16>>,
len: usize,
backend: SimdBackend,
}Expand description
A cache-line-oriented 16-ary max-heap for medium-to-large 32-bit heaps. BinaryHeap can be faster for small heaps and monotone replacements.
Fields§
§root: u32§blocks: Vec<HeapBlock<u32, 16>>§len: usize§backend: SimdBackendImplementations§
Source§impl DaryHeapU32
impl DaryHeapU32
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn peek(&self) -> Option<u32>
pub fn push(&mut self, value: u32)
pub fn pop(&mut self) -> Option<u32>
Sourcepub fn replace(&mut self, value: u32) -> Option<u32>
pub fn replace(&mut self, value: u32) -> Option<u32>
Unconditionally replaces the greatest value, or inserts into an empty heap.
pub fn clear(&mut self)
pub fn into_sorted_vec(self) -> Vec<u32>
fn empty(capacity: usize, backend: SimdBackend) -> Self
fn build(values: Vec<u32>, backend: SimdBackend) -> Self
fn encode(value: u32) -> u32
fn decode(value: u32) -> u32
fn key(&self, index: usize) -> u32
fn set_key(&mut self, index: usize, value: u32)
fn sift_down_by<F>(&mut self, hole: usize, value: u32, max_index: F)
fn heapify(&mut self)
Source§impl DaryHeapU32
impl DaryHeapU32
fn sift_down_scalar(&mut self, hole: usize, value: u32)
unsafe fn sift_down_avx2(&mut self, hole: usize, value: u32)
unsafe fn sift_down_avx512(&mut self, hole: usize, value: u32)
fn sift_down(&mut self, hole: usize, value: u32)
fn sift_down_after_pop(&mut self, hole: usize, value: u32)
Trait Implementations§
Source§impl Clone for DaryHeapU32
impl Clone for DaryHeapU32
Source§impl Debug for DaryHeapU32
impl Debug for DaryHeapU32
Source§impl Default for DaryHeapU32
impl Default for DaryHeapU32
Source§impl Extend<u32> for DaryHeapU32
impl Extend<u32> for DaryHeapU32
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = u32>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = u32>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<u32> for DaryHeapU32
impl FromIterator<u32> for DaryHeapU32
Auto Trait Implementations§
impl Freeze for DaryHeapU32
impl RefUnwindSafe for DaryHeapU32
impl Send for DaryHeapU32
impl Sync for DaryHeapU32
impl Unpin for DaryHeapU32
impl UnsafeUnpin for DaryHeapU32
impl UnwindSafe for DaryHeapU32
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more