Struct graph_builder::graph::csr::Csr
source · 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> RefUnwindSafe for Csr<Index, NI, EV>where EV: RefUnwindSafe, Index: RefUnwindSafe, NI: RefUnwindSafe,
impl<Index, NI, EV> Send for Csr<Index, NI, EV>where EV: Send, NI: Send,
impl<Index, NI, EV> Sync for Csr<Index, NI, EV>where EV: Sync, NI: Sync,
impl<Index, NI, EV> Unpin for Csr<Index, NI, EV>
impl<Index, NI, EV> UnwindSafe for Csr<Index, NI, EV>where EV: UnwindSafe, Index: UnwindSafe, NI: UnwindSafe,
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