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§

source§

impl<Index: Debug + Idx, NI: Debug, EV: Debug> Debug for Csr<Index, NI, EV>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<NI, EV, E> From<(&E, NI, Direction, CsrLayout)> for Csr<NI, NI, EV>where NI: Idx, EV: Copy + Send + Sync, E: Edges<NI = NI, EV = EV>,

source§

fn from( (edge_list, node_count, direction, csr_layout): (&E, NI, Direction, CsrLayout) ) -> Self

Converts to this type from the input type.
source§

impl<NI: Idx, EV> From<Csr<NI, NI, EV>> for UndirectedCsrGraph<NI, (), EV>

source§

fn from(csr: Csr<NI, NI, EV>) -> Self

Converts to this type from the input type.

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.