pub struct InternalSubGraph {
pub filter: SuBitGraph,
pub loopcount: Option<usize>,
}Expand description
Represents a subgraph consisting entirely of “internal” edges.
An internal subgraph is defined such that if a half-edge is part of this subgraph, its opposite half-edge must also be part of the subgraph. This means it cannot contain any “dangling” or “external” half-edges that connect to parts of the graph outside of itself. It represents a self-contained portion of the graph’s edge topology.
To represent a subgraph that does have external connections (or “hairs”),
use types like HedgeNode or [ContractedSubGraph].
Fields§
§filter: SuBitGraphA bitmask representing the set of half-edges included in this internal subgraph.
For every half-edge h included in this filter, its opposite inv(h) must also
be included.
loopcount: Option<usize>An optional field, often used to cache the cyclomatic number (number of independent cycles) within this subgraph once computed.
Implementations§
Source§impl InternalSubGraph
impl InternalSubGraph
Sourcepub unsafe fn new_unchecked(filter: SuBitGraph) -> Self
pub unsafe fn new_unchecked(filter: SuBitGraph) -> Self
Create a new subgraph from a filter.
§Safety
The filter must be valid, i.e. it must always have paired hedges.
Source§impl InternalSubGraph
impl InternalSubGraph
pub fn add_edge<E, V, H, N: NodeStorageOps<NodeData = V>>( &mut self, hedge: Hedge, graph: &HedgeGraph<E, V, H, N>, )
pub fn remove_edge<E, V, H, N: NodeStorageOps<NodeData = V>>( &mut self, hedge: Hedge, graph: &HedgeGraph<E, V, H, N>, )
pub fn try_new<E, V, H, N: NodeStorageOps<NodeData = V>>( filter: SuBitGraph, graph: &HedgeGraph<E, V, H, N>, ) -> Option<Self>
pub fn cleaned_filter_optimist<E, V, H, N: NodeStorageOps<NodeData = V>>( filter: SuBitGraph, graph: &HedgeGraph<E, V, H, N>, ) -> Self
pub fn cleaned_filter_pessimist<E, V, H, N: NodeStorageOps<NodeData = V>>( filter: SuBitGraph, graph: &HedgeGraph<E, V, H, N>, ) -> Self
pub fn valid<E, V, H, N: NodeStorageOps<NodeData = V>>( &self, graph: &HedgeGraph<E, V, H, N>, ) -> bool
pub fn to_hairy_subgraph<E, V, H, N: NodeStorageOps<NodeData = V>>( &self, graph: &HedgeGraph<E, V, H, N>, ) -> HedgeNode
pub fn set_loopcount<E, V, H, N: NodeStorageOps<NodeData = V>>( &mut self, graph: &HedgeGraph<E, V, H, N>, )
pub fn cycle_basis<E, V, H, N: NodeStorageOps<NodeData = V>>( &self, graph: &HedgeGraph<E, V, H, N>, ) -> (Vec<Cycle>, SimpleTraversalTree)
Trait Implementations§
Source§impl Clone for InternalSubGraph
impl Clone for InternalSubGraph
Source§fn clone(&self) -> InternalSubGraph
fn clone(&self) -> InternalSubGraph
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InternalSubGraph
impl Debug for InternalSubGraph
Source§impl<'de> Deserialize<'de> for InternalSubGraph
impl<'de> Deserialize<'de> for InternalSubGraph
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for InternalSubGraph
Source§impl Hash for InternalSubGraph
impl Hash for InternalSubGraph
Source§impl Inclusion<Hedge> for InternalSubGraph
impl Inclusion<Hedge> for InternalSubGraph
Source§impl Inclusion<HedgePair> for InternalSubGraph
impl Inclusion<HedgePair> for InternalSubGraph
Source§impl Inclusion<InternalSubGraph> for InternalSubGraph
impl Inclusion<InternalSubGraph> for InternalSubGraph
Source§fn includes(&self, other: &InternalSubGraph) -> bool
fn includes(&self, other: &InternalSubGraph) -> bool
other entity.Source§fn intersects(&self, other: &InternalSubGraph) -> bool
fn intersects(&self, other: &InternalSubGraph) -> bool
other entity.Source§impl Inclusion<RangeInclusive<Hedge>> for InternalSubGraph
impl Inclusion<RangeInclusive<Hedge>> for InternalSubGraph
Source§fn includes(&self, other: &RangeInclusive<Hedge>) -> bool
fn includes(&self, other: &RangeInclusive<Hedge>) -> bool
other entity.Source§fn intersects(&self, other: &RangeInclusive<Hedge>) -> bool
fn intersects(&self, other: &RangeInclusive<Hedge>) -> bool
other entity.Source§impl Inclusion<RangeToInclusive<Hedge>> for InternalSubGraph
impl Inclusion<RangeToInclusive<Hedge>> for InternalSubGraph
Source§fn includes(&self, other: &RangeToInclusive<Hedge>) -> bool
fn includes(&self, other: &RangeToInclusive<Hedge>) -> bool
other entity.Source§fn intersects(&self, other: &RangeToInclusive<Hedge>) -> bool
fn intersects(&self, other: &RangeToInclusive<Hedge>) -> bool
other entity.Source§impl Inclusion<SubSet<Hedge>> for InternalSubGraph
impl Inclusion<SubSet<Hedge>> for InternalSubGraph
Source§fn includes(&self, other: &SuBitGraph) -> bool
fn includes(&self, other: &SuBitGraph) -> bool
other entity.Source§fn intersects(&self, other: &SuBitGraph) -> bool
fn intersects(&self, other: &SuBitGraph) -> bool
other entity.Source§impl Index<Hedge> for InternalSubGraph
impl Index<Hedge> for InternalSubGraph
Source§impl PartialEq for InternalSubGraph
impl PartialEq for InternalSubGraph
Source§impl PartialOrd for InternalSubGraph
impl PartialOrd for InternalSubGraph
Source§impl Serialize for InternalSubGraph
impl Serialize for InternalSubGraph
Source§impl SubGraphLike for InternalSubGraph
impl SubGraphLike for InternalSubGraph
Source§fn nedges<E, V, H, N: NodeStorageOps<NodeData = V>>(
&self,
_graph: &HedgeGraph<E, V, H, N>,
) -> usize
fn nedges<E, V, H, N: NodeStorageOps<NodeData = V>>( &self, _graph: &HedgeGraph<E, V, H, N>, ) -> usize
Source§fn covers<E, V, H, N: NodeStorageOps<NodeData = V>, S: SubSetOps<Hedge> + SubSetLike<Hedge>>(
&self,
graph: &HedgeGraph<E, V, H, N>,
) -> S
fn covers<E, V, H, N: NodeStorageOps<NodeData = V>, S: SubSetOps<Hedge> + SubSetLike<Hedge>>( &self, graph: &HedgeGraph<E, V, H, N>, ) -> S
fn background_color(&self, hedge_pair: Option<HedgePair>) -> Option<String>
fn dot_fmt<W: Write, E, V, H, N: NodeStorageOps<NodeData = V>, Str: AsRef<str>>( &self, writer: &mut W, graph: &HedgeGraph<E, V, H, N>, graph_info: Str, hedge_attr: &impl Fn(&H) -> Option<String>, edge_attr: &impl Fn(&E) -> Option<String>, node_attr: &impl Fn(&V) -> Option<String>, ) -> Result<(), Error>
fn dot_io<W: Write, E, V, H, N: NodeStorageOps<NodeData = V>, Str: AsRef<str>>( &self, writer: &mut W, graph: &HedgeGraph<E, V, H, N>, graph_info: Str, hedge_attr: &impl Fn(&H) -> Option<String>, edge_attr: &impl Fn(&E) -> Option<String>, node_attr: &impl Fn(&V) -> Option<String>, ) -> Result<(), Error>
fn hairs(&self, node: impl Iterator<Item = Hedge>) -> SuBitGraph
Source§impl SubGraphOps for InternalSubGraph
impl SubGraphOps for InternalSubGraph
fn complement<E, V, H, N: NodeStorageOps<NodeData = V>>( &self, graph: &HedgeGraph<E, V, H, N>, ) -> Self
Source§impl SubSetLike for InternalSubGraph
impl SubSetLike for InternalSubGraph
type Base = SubSet<Hedge>
type BaseIter<'a> = SubSetIter<'a>
Source§fn has_greater(&self, hedge: Hedge) -> bool
fn has_greater(&self, hedge: Hedge) -> bool
fn included_iter(&self) -> Self::BaseIter<'_>
Source§fn n_included(&self) -> usize
fn n_included(&self) -> usize
fn empty(size: usize) -> Self
Source§fn included(&self) -> &SuBitGraph
fn included(&self) -> &SuBitGraph
fn string_label(&self) -> String
fn from_base62(label: &str, size: usize) -> Option<Self>
fn is_empty(&self) -> bool
Source§fn has_lesser(&self, hedge: ID) -> bool
fn has_lesser(&self, hedge: ID) -> bool
Source§impl SubSetOps for InternalSubGraph
impl SubSetOps for InternalSubGraph
fn intersect_with(&mut self, other: &InternalSubGraph)
fn union_with_iter(&mut self, other: impl Iterator<Item = Hedge>)
fn union_with(&mut self, other: &InternalSubGraph)
fn sym_diff_with(&mut self, other: &InternalSubGraph)
fn empty_intersection(&self, other: &InternalSubGraph) -> bool
fn empty_union(&self, other: &InternalSubGraph) -> bool
fn subtract_with(&mut self, other: &Self)
Source§fn all_pairwise_ops(
left: &mut AHashSet<Self>,
right: &[Self],
op: &impl Fn(&Self, &Self) -> Self,
) -> bool
fn all_pairwise_ops( left: &mut AHashSet<Self>, right: &[Self], op: &impl Fn(&Self, &Self) -> Self, ) -> bool
op between all elements of left (a mutable set)
and all elements of right (a slice), adding results to left.
Returns true if left was modified.fn all_pairwise_ops_filter_map( left: &mut AHashSet<Self>, right: &[Self], op: &impl Fn(&Self, &Self) -> Self, filter_map: &impl Fn(Self) -> Option<Self>, ) -> bool
fn all_pairwise_unions(left: &mut AHashSet<Self>, right: &[Self]) -> bool
fn all_pairwise_sym_diff(left: &mut AHashSet<Self>, right: &[Self]) -> bool
fn all_ops_iterative_filter_map( set: &[Self], op: &impl Fn(&Self, &Self) -> Self, filter_map: &impl Fn(Self) -> Option<Self>, ) -> AHashSet<Self>
fn all_unions_iterative(set: &[Self]) -> AHashSet<Self>
fn all_sym_diff_iterative(set: &[Self]) -> AHashSet<Self>
fn all_op_powerset_filter_map( set: &[Self], op: impl Fn(&mut Self, &Self), filter_map: &impl Fn(Self) -> Option<Self>, ) -> Result<AHashSet<Self>, TryFromIntError>
fn all_unions_powerset_filter_map( set: &[Self], filter_map: &impl Fn(Self) -> Option<Self>, ) -> Result<AHashSet<Self>, TryFromIntError>
fn all_sym_diff_powerset( set: &[Self], filter_map: &impl Fn(Self) -> Option<Self>, ) -> Result<AHashSet<Self>, TryFromIntError>
fn n_op( n: usize, set: &[Self], op: &impl Fn(&Self, &Self) -> Self, ) -> AHashSet<Self>
fn intersection(&self, other: &Self) -> Self
fn union(&self, other: &Self) -> Self
fn sym_diff(&self, other: &Self) -> Self
fn subtract(&self, other: &Self) -> Self
Auto Trait Implementations§
impl Freeze for InternalSubGraph
impl RefUnwindSafe for InternalSubGraph
impl Send for InternalSubGraph
impl Sync for InternalSubGraph
impl Unpin for InternalSubGraph
impl UnsafeUnpin for InternalSubGraph
impl UnwindSafe for InternalSubGraph
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.