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>
where Ty: EdgeType, Ix: IndexType,

source

pub fn new<N, E>(g: &Graph<N, E, Ty, Ix>) -> Self

source

pub fn is_complete(&self) -> bool

Return true if we have a complete mapping

source

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.

source

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

source

pub fn next_out_index(&self, from_index: usize) -> Option<usize>

Find the next (least) node in the Tout set.

source

pub fn next_in_index(&self, from_index: usize) -> Option<usize>

Find the next (least) node in the Tin set.

source

pub fn next_rest_index(&self, from_index: usize) -> Option<usize>

Find the next (least) node in the N - M set.

Trait Implementations§

source§

impl<Ty: Debug, Ix: Debug> Debug for Vf2State<Ty, Ix>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Ty, Ix> Freeze for Vf2State<Ty, Ix>

§

impl<Ty, Ix> RefUnwindSafe for Vf2State<Ty, Ix>

§

impl<Ty, Ix> Send for Vf2State<Ty, Ix>
where Ty: Send, Ix: Send,

§

impl<Ty, Ix> Sync for Vf2State<Ty, Ix>
where Ty: Sync, Ix: Sync,

§

impl<Ty, Ix> Unpin for Vf2State<Ty, Ix>
where Ty: Unpin, Ix: Unpin,

§

impl<Ty, Ix> UnwindSafe for Vf2State<Ty, Ix>
where Ty: UnwindSafe, Ix: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.