Struct petgraph::isomorphism::Vf2State
source · struct Vf2State<Ty, Ix> {
mapping: Vec<NodeIndex<Ix>>,
out: Vec<usize>,
ins: Vec<usize>,
out_size: usize,
ins_size: usize,
adjacency_matrix: FixedBitSet,
generation: usize,
_etype: PhantomData<Ty>,
}
Fields§
§mapping: Vec<NodeIndex<Ix>>
The current mapping M(s) of nodes from G0 → G1 and G1 → G0, NodeIndex::end() for no mapping.
out: Vec<usize>
out[i] is non-zero if i is in either M_0(s) or Tout_0(s) These are all the next vertices that are not mapped yet, but have an outgoing edge from the mapping.
ins: Vec<usize>
ins[i] is non-zero if i is in either M_0(s) or Tin_0(s) These are all the incoming vertices, those not mapped yet, but have an edge from them into the mapping. Unused if graph is undirected – it’s identical with out in that case.
out_size: usize
§ins_size: usize
§adjacency_matrix: FixedBitSet
§generation: usize
§_etype: PhantomData<Ty>
Implementations§
source§impl<Ty, Ix> Vf2State<Ty, Ix>
impl<Ty, Ix> Vf2State<Ty, Ix>
pub fn new<N, E>(g: &Graph<N, E, Ty, Ix>) -> Self
sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Return true if we have a complete mapping
sourcepub fn push_mapping<N, E>(
&mut self,
from: NodeIndex<Ix>,
to: NodeIndex<Ix>,
g: &Graph<N, E, Ty, Ix>,
)
pub fn push_mapping<N, E>( &mut self, from: NodeIndex<Ix>, to: NodeIndex<Ix>, g: &Graph<N, E, Ty, Ix>, )
Add mapping from <-> to to the state.
sourcepub fn pop_mapping<N, E>(
&mut self,
from: NodeIndex<Ix>,
g: &Graph<N, E, Ty, Ix>,
)
pub fn pop_mapping<N, E>( &mut self, from: NodeIndex<Ix>, g: &Graph<N, E, Ty, Ix>, )
Restore the state to before the last added mapping
sourcepub fn next_out_index(&self, from_index: usize) -> Option<usize>
pub fn next_out_index(&self, from_index: usize) -> Option<usize>
Find the next (least) node in the Tout set.
sourcepub fn next_in_index(&self, from_index: usize) -> Option<usize>
pub fn next_in_index(&self, from_index: usize) -> Option<usize>
Find the next (least) node in the Tin set.
sourcepub fn next_rest_index(&self, from_index: usize) -> Option<usize>
pub fn next_rest_index(&self, from_index: usize) -> Option<usize>
Find the next (least) node in the N - M set.
Trait Implementations§
Auto Trait Implementations§
impl<Ty, Ix> Freeze for Vf2State<Ty, Ix>
impl<Ty, Ix> RefUnwindSafe for Vf2State<Ty, Ix>where
Ty: RefUnwindSafe,
Ix: RefUnwindSafe,
impl<Ty, Ix> Send for Vf2State<Ty, Ix>
impl<Ty, Ix> Sync for Vf2State<Ty, Ix>
impl<Ty, Ix> Unpin for Vf2State<Ty, Ix>
impl<Ty, Ix> UnwindSafe for Vf2State<Ty, Ix>where
Ty: UnwindSafe,
Ix: 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