pub struct CsrGraph {
pub n: usize,
pub row_ptr: Vec<usize>,
pub col_idx: Vec<usize>,
}Expand description
CSR-formatted directed graph: row_ptr of length n+1 and col_idx of length m.
Fields§
§n: usize§row_ptr: Vec<usize>§col_idx: Vec<usize>Implementations§
Source§impl CsrGraph
impl CsrGraph
Sourcepub fn from_adjacency_list(adj: &AdjacencyList) -> Self
pub fn from_adjacency_list(adj: &AdjacencyList) -> Self
Build a CSR graph from an AdjacencyList.
Sourcepub fn neighbors(&self, u: usize) -> GraphalgResult<&[usize]>
pub fn neighbors(&self, u: usize) -> GraphalgResult<&[usize]>
Neighbors of vertex u in this CSR graph.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CsrGraph
impl RefUnwindSafe for CsrGraph
impl Send for CsrGraph
impl Sync for CsrGraph
impl Unpin for CsrGraph
impl UnsafeUnpin for CsrGraph
impl UnwindSafe for CsrGraph
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