pub fn connected_components_by_site(&self) -> Vec<ComponentLabel> {
            use petgraph::visit::NodeIndexable;

            // petgraph has a connected_components function, but it only gives the count!
            // ho hum.
            let mut vertex_sets = petgraph::unionfind::UnionFind::new(self.node_bound());
            for edge in self.0.edge_references() {
                let (a, b) = (edge.source(), edge.target());
                vertex_sets.union(self.to_index(a), self.to_index(b));
            }
            ComponentLabel::wrap_vec_with_newtype(vertex_sets.into_labeling())
        }
/// Get keys labelling each site by the connected component it belongs to.
///
/// The keys are assigned deterministically, but arbitrarily, and are **not**
/// necessarily consecutive integers.
Get keys labelling each site by the connected component it belongs to.
The keys are assigned deterministically, but arbitrarily, and are **not
necessarily consecutive integers.
Get keys labelling each site by the connected component it belongs to . The keys are assigned deterministically but arbitrarily and are ** not necessarily consecutive integers .
pub fn connected_components_by_site(&self) -> Vec<ComponentLabel> {
            use petgraph::visit::NodeIndexable;
            // petgraph has a connected_components function, but it only gives the count!
            // ho hum.
            let mut vertex_sets = petgraph::unionfind::UnionFind::new(self.node_bound());
            for edge in self.0.edge_references() {
                let (a, b) = (edge.source(), edge.target());
                vertex_sets.union(self.to_index(a), self.to_index(b));
            }
            ComponentLabel::wrap_vec_with_newtype(vertex_sets.into_labeling())
        }
pub fn connected_components_by_site ( & self ) -> Vec < ComponentLabel > { use petgraph :: visit :: NodeIndexable ; // petgraph has a connected_components function, but it only gives the count! // ho hum. let mut vertex_sets = petgraph :: unionfind :: UnionFind :: new ( self . node_bound ( ) ) ; for edge in self . 0 . edge_references ( ) { let ( a , b ) = ( edge . source ( ) , edge . target ( ) ) ; vertex_sets . union ( self . to_index ( a ) , self . to_index ( b ) ) ; } ComponentLabel :: wrap_vec_with_newtype ( vertex_sets . into_labeling ( ) ) }
Get keys labelling each site by the connected component it belongs to.
Get keys labelling each site by the connected component it belongs to .
&self
&self