[−][src]Struct louds_rs::louds::Louds
LOUDS (Level-Order Unary Degree Sequence).
This class can handle tree structure of virtually arbitrary number of nodes.
In fact, N (number of nodes in the tree) is designed to be limited to: N < 2^64 / 2, while each node is represented in 2bits in average.
It should be enough for almost all usecases since a binary data of length of 2^63 consumes 2^20 = 1,048,576 TB (terabytes), which is hard to handle by state-of-the-art computer architecture.
Methods
impl Louds
[src][−]
pub fn node_num_to_index(&self, node_num: LoudsNodeNum) -> LoudsIndex
[src][−]
Panics
node_num
does not exist in this LOUDS.
pub fn index_to_node_num(&self, index: LoudsIndex) -> LoudsNodeNum
[src][−]
Panics
index
does not point to any node in this LOUDS.
pub fn child_to_parent(&self, index: LoudsIndex) -> LoudsNodeNum
[src][−]
Panics
index
does not point to any node in this LOUDS.index == 0
: (node#1 is root and doesn't have parent)
pub fn parent_to_children(&self, node_num: LoudsNodeNum) -> Vec<LoudsIndex>
[src][−]
Panics
node_num
does not exist in this LOUDS.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src][−]
impl<T, U> Into for T where
U: From<T>,
[src][−]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src][−]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src][−]
impl<T> Borrow for T where
T: ?Sized,
[src][−]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src][−]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src][−]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src][−]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src][−]
U: TryFrom<T>,