pub struct CsrIndex {
pub offsets: Vec<u64>,
pub edge_ids: Vec<u64>,
pub neighbor_ids: Vec<u64>,
}Expand description
In-memory CSR adjacency structure, surrogate-keyed.
Neighbors of node_id = i are
(edge_ids[j], neighbor_ids[j]) for j in offsets[i]..offsets[i + 1].
§Invariants (enforced on read and write)
offsetsis non-empty andoffsets[0] == 0— the empty graph isoffsets == [0]with empty targets, never an emptyoffsets.offsetsis monotonically non-decreasing; a node with no neighbors is an empty range.*offsets.last() == edge_ids.len() == neighbor_ids.len().
Fields§
§offsets: Vec<u64>CSR offsets, length node_count + 1.
edge_ids: Vec<u64>Edge surrogate per adjacency entry, in CSR order.
neighbor_ids: Vec<u64>Neighbor node surrogate per adjacency entry, in CSR order.
Implementations§
Source§impl CsrIndex
impl CsrIndex
Sourcepub fn node_count(&self) -> u64
pub fn node_count(&self) -> u64
Number of source nodes covered (CSR row count).
Sourcepub fn edge_count(&self) -> u64
pub fn edge_count(&self) -> u64
Number of (edge, neighbor) adjacency entries.
Trait Implementations§
impl Eq for CsrIndex
impl StructuralPartialEq for CsrIndex
Auto Trait Implementations§
impl Freeze for CsrIndex
impl RefUnwindSafe for CsrIndex
impl Send for CsrIndex
impl Sync for CsrIndex
impl Unpin for CsrIndex
impl UnsafeUnpin for CsrIndex
impl UnwindSafe for CsrIndex
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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