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