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