pub struct Sccs { /* private fields */ }
Expand description
Strongly connected components.
An instance of this structure stores the index of the
component of each node. Components are numbered from 0 to
num_components
.
Moreover, this structure makes it possible to sort the components by size, possibly using parallel methods.
Implementations§
Source§impl Sccs
impl Sccs
pub fn new(num_components: usize, components: Box<[usize]>) -> Self
Sourcepub fn num_components(&self) -> usize
pub fn num_components(&self) -> usize
Returns the number of strongly connected components.
Sourcepub fn components(&self) -> &[usize]
pub fn components(&self) -> &[usize]
Returns a slice containing, for each node, the index of the component it belongs to.
Sourcepub fn compute_sizes(&self) -> Box<[usize]>
pub fn compute_sizes(&self) -> Box<[usize]>
Returns the sizes of all components.
Sourcepub fn sort_by_size(&mut self) -> Box<[usize]>
pub fn sort_by_size(&mut self) -> Box<[usize]>
Renumbers the components by decreasing size.
After a call to this method, the sizes of strongly connected components will decreasing in the component index. The method returns the sizes of the components after the renumbering.
Sourcepub fn par_sort_by_size(&mut self) -> Box<[usize]>
pub fn par_sort_by_size(&mut self) -> Box<[usize]>
Renumbers the components by decreasing size using parallel methods.
After a call to this method, the sizes of strongly connected components will decreasing in the component index. The method returns the sizes of the components after the renumbering.
Auto Trait Implementations§
impl Freeze for Sccs
impl RefUnwindSafe for Sccs
impl Send for Sccs
impl Sync for Sccs
impl Unpin for Sccs
impl UnwindSafe for Sccs
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
Source§impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
Source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
Source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
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 more