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