pub struct StrengthGraph {
pub n: usize,
pub strong_neighbors: Vec<Vec<usize>>,
pub strong_influencers: Vec<Vec<usize>>,
}Expand description
Strength-of-connection graph: adjacency list of strong neighbors
Fields§
§n: usizeNumber of nodes
strong_neighbors: Vec<Vec<usize>>strong_neighbors[i] = nodes j such that i strongly influences j
(i.e., |a_ij| >= θ * max_k |a_ik|)
strong_influencers: Vec<Vec<usize>>strong_influencers[i] = nodes j such that j strongly influences i
(transpose of strong_neighbors)
Implementations§
Source§impl StrengthGraph
impl StrengthGraph
Sourcepub fn from_neighbors(n: usize, strong_neighbors: Vec<Vec<usize>>) -> Self
pub fn from_neighbors(n: usize, strong_neighbors: Vec<Vec<usize>>) -> Self
Create a StrengthGraph from the strong_neighbors adjacency list. Computes strong_influencers as the transpose.
Sourcepub fn is_strongly_connected(&self, i: usize, j: usize) -> bool
pub fn is_strongly_connected(&self, i: usize, j: usize) -> bool
Check if i and j are strongly connected (in either direction)
Trait Implementations§
Source§impl Clone for StrengthGraph
impl Clone for StrengthGraph
Source§fn clone(&self) -> StrengthGraph
fn clone(&self) -> StrengthGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StrengthGraph
impl RefUnwindSafe for StrengthGraph
impl Send for StrengthGraph
impl Sync for StrengthGraph
impl Unpin for StrengthGraph
impl UnsafeUnpin for StrengthGraph
impl UnwindSafe for StrengthGraph
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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