pub struct AdjacencyGraph {
pub num_vertices: usize,
pub adj_ptr: Vec<usize>,
pub adj_list: Vec<usize>,
}Expand description
Undirected graph of a symmetric sparse matrix in CSR-like form.
Self-loops (diagonal entries) are excluded. Each edge (i,j) appears in
both neighbors(i) and neighbors(j).
Fields§
§num_vertices: usizeNumber of vertices.
adj_ptr: Vec<usize>CSR-style pointers into adj_list. Length = num_vertices + 1.
adj_list: Vec<usize>Concatenated adjacency lists for all vertices.
Implementations§
Source§impl AdjacencyGraph
impl AdjacencyGraph
Sourcepub fn from_symmetric_csr(
row_ptr: &[i32],
col_indices: &[i32],
n: usize,
) -> Self
pub fn from_symmetric_csr( row_ptr: &[i32], col_indices: &[i32], n: usize, ) -> Self
Build an adjacency graph from a symmetric CSR matrix.
Diagonal entries are excluded. The CSR uses i32 indices (matching
cuSPARSE convention). Both upper and lower triangular parts should be
present for a symmetric matrix.
Trait Implementations§
Source§impl Clone for AdjacencyGraph
impl Clone for AdjacencyGraph
Source§fn clone(&self) -> AdjacencyGraph
fn clone(&self) -> AdjacencyGraph
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 AdjacencyGraph
impl RefUnwindSafe for AdjacencyGraph
impl Send for AdjacencyGraph
impl Sync for AdjacencyGraph
impl Unpin for AdjacencyGraph
impl UnsafeUnpin for AdjacencyGraph
impl UnwindSafe for AdjacencyGraph
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