pub struct Matching<G: GraphBase> { /* private fields */ }
Expand description
Computed matching of the graph.
Implementations§
source§impl<G> Matching<G>where
G: NodeIndexable,
impl<G> Matching<G>where G: NodeIndexable,
sourcepub fn mate(&self, node: G::NodeId) -> Option<G::NodeId>
pub fn mate(&self, node: G::NodeId) -> Option<G::NodeId>
Gets the matched counterpart of given node, if there is any.
Returns None
if the node is not matched or does not exist.
sourcepub fn edges(&self) -> MatchedEdges<'_, G> ⓘ
pub fn edges(&self) -> MatchedEdges<'_, G> ⓘ
Iterates over all edges from the matching.
An edge is represented by its endpoints. The graph is considered undirected and every pair of matched nodes is reported only once.
sourcepub fn nodes(&self) -> MatchedNodes<'_, G> ⓘ
pub fn nodes(&self) -> MatchedNodes<'_, G> ⓘ
Iterates over all nodes from the matching.
sourcepub fn contains_edge(&self, a: G::NodeId, b: G::NodeId) -> bool
pub fn contains_edge(&self, a: G::NodeId, b: G::NodeId) -> bool
Returns true
if given edge is in the matching, or false
otherwise.
If any of the nodes does not exist, false
is returned.
sourcepub fn contains_node(&self, node: G::NodeId) -> bool
pub fn contains_node(&self, node: G::NodeId) -> bool
Returns true
if given node is in the matching, or false
otherwise.
If the node does not exist, false
is returned.
Auto Trait Implementations§
impl<G> RefUnwindSafe for Matching<G>where G: RefUnwindSafe, <G as GraphBase>::NodeId: RefUnwindSafe,
impl<G> Send for Matching<G>where G: Send, <G as GraphBase>::NodeId: Send,
impl<G> Sync for Matching<G>where G: Sync, <G as GraphBase>::NodeId: Sync,
impl<G> Unpin for Matching<G>where G: Unpin, <G as GraphBase>::NodeId: Unpin,
impl<G> UnwindSafe for Matching<G>where G: UnwindSafe, <G as GraphBase>::NodeId: UnwindSafe,
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