pub struct Closure { /* private fields */ }Expand description
The ancestor and descendant sets of every node.
Implementations§
Source§impl Closure
impl Closure
Sourcepub fn compute(is_a: &Csr) -> Result<Self, ClosureError>
pub fn compute(is_a: &Csr) -> Result<Self, ClosureError>
Computes the closure of is_a, whose edges point from child to parent.
§Errors
Returns ClosureError::Cycle when the edges are not acyclic.
Sourcepub fn from_parts(
ancestors: Vec<RoaringBitmap>,
descendants: Vec<RoaringBitmap>,
) -> Self
pub fn from_parts( ancestors: Vec<RoaringBitmap>, descendants: Vec<RoaringBitmap>, ) -> Self
Reassembles a closure from its two bitmap lists.
Sourcepub fn size_in_bytes(&self) -> usize
pub fn size_in_bytes(&self) -> usize
The heap bytes the two bitmap lists hold (crate::footprint).
Sourcepub fn ancestors_size_in_bytes(&self) -> usize
pub fn ancestors_size_in_bytes(&self) -> usize
The heap bytes the ancestor sets alone hold.
Subsumption reads the ancestors and an expansion reads the descendants, so the two halves are reported apart.
Sourcepub fn ancestors(&self, node: Ordinal) -> &RoaringBitmap
pub fn ancestors(&self, node: Ordinal) -> &RoaringBitmap
The proper ancestors of node (ECL >); empty for an unknown node.
Sourcepub fn descendants(&self, node: Ordinal) -> &RoaringBitmap
pub fn descendants(&self, node: Ordinal) -> &RoaringBitmap
The proper descendants of node (ECL <); empty for an unknown node.
Sourcepub fn descendants_or_self(&self, node: Ordinal) -> RoaringBitmap
pub fn descendants_or_self(&self, node: Ordinal) -> RoaringBitmap
node and its descendants (ECL <<).
Sourcepub fn ancestors_or_self(&self, node: Ordinal) -> RoaringBitmap
pub fn ancestors_or_self(&self, node: Ordinal) -> RoaringBitmap
node and its ancestors (ECL >>).
Sourcepub fn is_ancestor(&self, ancestor: Ordinal, node: Ordinal) -> bool
pub fn is_ancestor(&self, ancestor: Ordinal, node: Ordinal) -> bool
Whether ancestor is a proper ancestor of node.
Sourcepub fn ancestor_sets(&self) -> &[RoaringBitmap]
pub fn ancestor_sets(&self) -> &[RoaringBitmap]
The ancestor bitmaps, in ordinal order.
Sourcepub fn descendant_sets(&self) -> &[RoaringBitmap]
pub fn descendant_sets(&self) -> &[RoaringBitmap]
The descendant bitmaps, in ordinal order.