pub struct Csr<Index: Idx, NI, EV> { /* private fields */ }Expand description
A Compressed-Sparse-Row data structure to represent sparse graphs.
The data structure is composed of two arrays: offsets and targets. For a
graph with node count n and edge count m, offsets has exactly n + 1
and targets exactly m entries.
For a given node u, offsets[u] stores the start index of the neighbor
list of u in targets. The degree of u, i.e., the length of the
neighbor list is defined by offsets[u + 1] - offsets[u]. The neighbor list
of u is defined by the slice &targets[offsets[u]..offsets[u + 1]].
Trait Implementations§
Auto Trait Implementations§
impl<Index, NI, EV> Freeze for Csr<Index, NI, EV>
impl<Index, NI, EV> RefUnwindSafe for Csr<Index, NI, EV>
impl<Index, NI, EV> Send for Csr<Index, NI, EV>
impl<Index, NI, EV> Sync for Csr<Index, NI, EV>
impl<Index, NI, EV> Unpin for Csr<Index, NI, EV>
impl<Index, NI, EV> UnsafeUnpin for Csr<Index, NI, EV>
impl<Index, NI, EV> UnwindSafe for Csr<Index, NI, EV>
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> 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