pub struct CohesiveBlocks {
pub blocks: Vec<Vec<VertexId>>,
pub cohesion: Vec<usize>,
pub parent: Vec<Option<usize>>,
pub block_tree: Graph,
}Expand description
The cohesive block hierarchy of a graph, see Graph::cohesive_blocks.
Block 0 is always the whole graph; the lists are indexed by block id.
Fields§
§blocks: Vec<Vec<VertexId>>The vertex ids of each block.
cohesion: Vec<usize>The cohesion (vertex connectivity) of each block.
parent: Vec<Option<usize>>The parent block of each block in the hierarchy (None for the root).
block_tree: GraphThe hierarchy as a (directed) tree graph: vertex i is block i, and
there is an edge from each block to each of its children.
Implementations§
Source§impl CohesiveBlocks
impl CohesiveBlocks
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether there are no blocks. Results of Graph::cohesive_blocks
always contain at least the root block (even for the null graph,
whose root block is empty), so this is false for them.
Sourcepub fn max_cohesion_of(&self, v: VertexId) -> Option<usize>
pub fn max_cohesion_of(&self, v: VertexId) -> Option<usize>
The largest cohesion of a block containing vertex v (its
“embeddedness”), or None if no block contains it.
Trait Implementations§
Source§impl Clone for CohesiveBlocks
impl Clone for CohesiveBlocks
Source§fn clone(&self) -> CohesiveBlocks
fn clone(&self) -> CohesiveBlocks
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CohesiveBlocks
impl Debug for CohesiveBlocks
Source§impl PartialEq for CohesiveBlocks
impl PartialEq for CohesiveBlocks
Source§fn eq(&self, other: &CohesiveBlocks) -> bool
fn eq(&self, other: &CohesiveBlocks) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CohesiveBlocks
Auto Trait Implementations§
impl !Sync for CohesiveBlocks
impl Freeze for CohesiveBlocks
impl RefUnwindSafe for CohesiveBlocks
impl Send for CohesiveBlocks
impl Unpin for CohesiveBlocks
impl UnsafeUnpin for CohesiveBlocks
impl UnwindSafe for CohesiveBlocks
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