Components

Struct Components 

Source
pub struct Components<V> { /* private fields */ }
Expand description

Strongly connected components.

Implementations§

Source§

impl<V> Components<V>

Source

pub fn len(&self) -> usize

Returns the number of strongly connected components.

Source

pub fn is_empty(&self) -> bool

Checks if there are no components.

Source

pub fn iter(&self) -> Iter<'_, V>

Returns an iterator over the strongly connected components.

Source

pub fn vertex_component_index(&self, v: &V) -> Option<usize>
where V: Eq + Hash,

Returns the index of the given vertex’s strongly connected component.

Source

pub fn get_by_index(&self, i: usize) -> Option<&[V]>

Returns the component with the given index i.

Source

pub fn get(&self, v: &V) -> Option<&[V]>
where V: Eq + Hash,

Return the given vertex’s strongly connected component.

Source

pub fn successors(&self, i: usize) -> Option<impl '_ + Iterator<Item = usize>>

Source

pub fn is_cyclic(&self, i: usize) -> bool

Source

pub fn direct_successors(&self, i: usize) -> Option<HashSet<usize>>

Source

pub fn depths(&self) -> Vec<usize>

Returns the depth of each component.

The depth of a component is the maximum of the depth of its predecessors plus 1. A component with no predecessors has depth 0.

Source

pub fn predecessors(&self) -> Vec<HashSet<usize>>

Source

pub fn order_by_depth(&self) -> Vec<usize>

Order components by depth.

The depth of a component is the maximum of the depth of its predecessors plus 1. A component with no predecessors has depth 0.

Trait Implementations§

Source§

impl<'a, V> IntoIterator for &'a Components<V>

Source§

type Item = &'a [V]

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, V>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<V> Freeze for Components<V>

§

impl<V> RefUnwindSafe for Components<V>
where V: RefUnwindSafe,

§

impl<V> Send for Components<V>
where V: Send,

§

impl<V> Sync for Components<V>
where V: Sync,

§

impl<V> Unpin for Components<V>
where V: Unpin,

§

impl<V> UnwindSafe for Components<V>
where V: 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>,

Source§

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>,

Source§

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.