pub struct DaryHeapI64 {
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 DaryHeapI64
impl DaryHeapI64
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<i64>
pub fn push(&mut self, value: i64)
pub fn pop(&mut self) -> Option<i64>
Sourcepub fn replace(&mut self, value: i64) -> Option<i64>
pub fn replace(&mut self, value: i64) -> Option<i64>
Unconditionally replaces the greatest value, or inserts into an empty heap.
pub fn clear(&mut self)
pub fn into_sorted_vec(self) -> Vec<i64>
fn empty(capacity: usize, backend: SimdBackend) -> Self
fn build(values: Vec<i64>, backend: SimdBackend) -> Self
fn encode(value: i64) -> u64
fn decode(value: u64) -> i64
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 DaryHeapI64
impl DaryHeapI64
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 DaryHeapI64
impl Clone for DaryHeapI64
Source§impl Debug for DaryHeapI64
impl Debug for DaryHeapI64
Source§impl Default for DaryHeapI64
impl Default for DaryHeapI64
Source§impl Extend<i64> for DaryHeapI64
impl Extend<i64> for DaryHeapI64
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = i64>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = i64>,
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<i64> for DaryHeapI64
impl FromIterator<i64> for DaryHeapI64
Auto Trait Implementations§
impl Freeze for DaryHeapI64
impl RefUnwindSafe for DaryHeapI64
impl Send for DaryHeapI64
impl Sync for DaryHeapI64
impl Unpin for DaryHeapI64
impl UnsafeUnpin for DaryHeapI64
impl UnwindSafe for DaryHeapI64
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