pub struct WeakKonigTree {
pub max_depth: u32,
pub nodes: Vec<u64>,
pub depths: Vec<u32>,
}Expand description
A finite approximation to an infinite binary tree (König / WKL₀). Nodes are stored as bit-strings of bounded length.
Fields§
§max_depth: u32Maximum depth of stored nodes.
nodes: Vec<u64>The set of nodes (as u64 bit-strings of length ≤ max_depth).
depths: Vec<u32>The length of each node bit-string (parallel to nodes).
Implementations§
Source§impl WeakKonigTree
impl WeakKonigTree
Sourcepub fn count_at_depth(&self, d: u32) -> usize
pub fn count_at_depth(&self, d: u32) -> usize
Return the number of nodes at depth d.
Sourcepub fn is_infinite(&self) -> bool
pub fn is_infinite(&self) -> bool
Return true if the tree is infinite (has nodes at every depth 0..=max_depth).
Sourcepub fn greedy_path(&self) -> Vec<u8> ⓘ
pub fn greedy_path(&self) -> Vec<u8> ⓘ
Greedily extract an infinite path (always extend with bit 0 if possible, else 1). Returns the sequence of bits representing the path.
Trait Implementations§
Source§impl Clone for WeakKonigTree
impl Clone for WeakKonigTree
Source§fn clone(&self) -> WeakKonigTree
fn clone(&self) -> WeakKonigTree
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WeakKonigTree
impl RefUnwindSafe for WeakKonigTree
impl Send for WeakKonigTree
impl Sync for WeakKonigTree
impl Unpin for WeakKonigTree
impl UnsafeUnpin for WeakKonigTree
impl UnwindSafe for WeakKonigTree
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