pub struct DaryHeapU128 {
root: u128,
blocks: Vec<U128HeapBlock>,
len: usize,
backend: SimdBackend,
}Expand description
A cache-line-oriented 4-ary max-heap for large full-width 128-bit heaps. BinaryHeap can be faster for small heaps, monotone replacements, and heavily repeated keys.
Fields§
§root: u128§blocks: Vec<U128HeapBlock>§len: usize§backend: SimdBackendImplementations§
Source§impl DaryHeapU128
impl DaryHeapU128
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<u128>
pub fn push(&mut self, value: u128)
pub fn pop(&mut self) -> Option<u128>
Sourcepub fn replace(&mut self, value: u128) -> Option<u128>
pub fn replace(&mut self, value: u128) -> Option<u128>
Unconditionally replaces the greatest value, or inserts into an empty heap.
pub fn clear(&mut self)
pub fn into_sorted_vec(self) -> Vec<u128>
fn empty(capacity: usize, backend: SimdBackend) -> Self
fn build(values: Vec<u128>, backend: SimdBackend) -> Self
fn encode(value: u128) -> u128
fn decode(value: u128) -> u128
fn key(&self, index: usize) -> u128
fn set_key(&mut self, index: usize, value: u128)
fn sift_down_by<F>(&mut self, hole: usize, value: u128, max_index: F)
fn heapify(&mut self)
Source§impl DaryHeapU128
impl DaryHeapU128
fn sift_down_scalar(&mut self, hole: usize, value: u128)
unsafe fn sift_down_avx2(&mut self, hole: usize, value: u128)
unsafe fn sift_down_avx512(&mut self, hole: usize, value: u128)
fn sift_down(&mut self, hole: usize, value: u128)
fn sift_down_after_pop(&mut self, hole: usize, value: u128)
Trait Implementations§
Source§impl Clone for DaryHeapU128
impl Clone for DaryHeapU128
Source§impl Debug for DaryHeapU128
impl Debug for DaryHeapU128
Source§impl Default for DaryHeapU128
impl Default for DaryHeapU128
Source§impl Extend<u128> for DaryHeapU128
impl Extend<u128> for DaryHeapU128
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = u128>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = u128>,
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<u128> for DaryHeapU128
impl FromIterator<u128> for DaryHeapU128
Auto Trait Implementations§
impl Freeze for DaryHeapU128
impl RefUnwindSafe for DaryHeapU128
impl Send for DaryHeapU128
impl Sync for DaryHeapU128
impl Unpin for DaryHeapU128
impl UnsafeUnpin for DaryHeapU128
impl UnwindSafe for DaryHeapU128
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