pub struct UndirectedCsrGraph<NI, NV = (), EV = ()>where
    NI: Idx,{ /* private fields */ }

Implementations§

source§

impl<NI, NV, EV> UndirectedCsrGraph<NI, NV, EV>where NI: Idx,

source

pub fn new( node_values: NodeValues<NV>, csr: Csr<NI, NI, EV> ) -> UndirectedCsrGraph<NI, NV, EV>

Trait Implementations§

source§

impl<R, NI, NV, EV> DeserializeGraphOp<R, UndirectedCsrGraph<NI, NV, EV>> for UndirectedCsrGraph<NI, NV, EV>where R: Read, NI: Idx + ToMutByteSlice, NV: ToMutByteSlice, EV: ToMutByteSlice,

source§

fn deserialize(read: R) -> Result<UndirectedCsrGraph<NI, NV, EV>, Error>

source§

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

source§

fn from(_: (E, CsrLayout)) -> UndirectedCsrGraph<NI, (), EV>

Converts to this type from the input type.
source§

impl<NI, NV, EV, E> From<(NodeValues<NV>, E, CsrLayout)> for UndirectedCsrGraph<NI, NV, EV>where NI: Idx, EV: Copy + Send + Sync, E: Edges<NI = NI, EV = EV>,

source§

fn from(_: (NodeValues<NV>, E, CsrLayout)) -> UndirectedCsrGraph<NI, NV, EV>

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

impl<NI, NV, EV> Graph<NI> for UndirectedCsrGraph<NI, NV, EV>where NI: Idx,

source§

fn node_count(&self) -> NI

Returns the number of nodes in the graph.
source§

fn edge_count(&self) -> NI

Returns the number of edges in the graph.
source§

impl<NI, NV, EV> NodeValues<NI, NV> for UndirectedCsrGraph<NI, NV, EV>where NI: Idx,

source§

fn node_value(&self, node: NI) -> &NV

source§

impl<W, NI, NV, EV> SerializeGraphOp<W> for UndirectedCsrGraph<NI, NV, EV>where W: Write, NI: Idx + ToByteSlice, NV: ToByteSlice, EV: ToByteSlice,

source§

fn serialize(&self, output: W) -> Result<(), Error>

source§

impl<NI, NV, EV> SwapCsr<NI, NI, EV> for UndirectedCsrGraph<NI, NV, EV>where NI: Idx,

source§

fn swap_csr( &mut self, csr: Csr<NI, NI, EV> ) -> &mut UndirectedCsrGraph<NI, NV, EV>

source§

impl<NI, EV> TryFrom<(PathBuf, CsrLayout)> for UndirectedCsrGraph<NI, EV>where NI: Idx + ToMutByteSlice, EV: ToMutByteSlice,

§

type Error = Error

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

fn try_from( _: (PathBuf, CsrLayout) ) -> Result<UndirectedCsrGraph<NI, EV>, <UndirectedCsrGraph<NI, EV> as TryFrom<(PathBuf, CsrLayout)>>::Error>

Performs the conversion.
source§

impl<NI, NV, EV> UndirectedDegrees<NI> for UndirectedCsrGraph<NI, NV, EV>where NI: Idx,

source§

fn degree(&self, node: NI) -> NI

Returns the number of edges connected to the given node.
source§

impl<NI, NV> UndirectedNeighbors<NI> for UndirectedCsrGraph<NI, NV>where NI: Idx,

§

type NeighborsIterator<'a> = Iter<'a, NI> where NV: 'a

source§

fn neighbors( &self, node: NI ) -> <UndirectedCsrGraph<NI, NV> as UndirectedNeighbors<NI>>::NeighborsIterator<'_>

Returns an iterator of all nodes connected to the given node.
source§

impl<NI, NV, EV> UndirectedNeighborsWithValues<NI, EV> for UndirectedCsrGraph<NI, NV, EV>where NI: Idx,

§

type NeighborsIterator<'a> = Iter<'a, Target<NI, EV>> where NV: 'a, EV: 'a

source§

fn neighbors_with_values( &self, node: NI ) -> <UndirectedCsrGraph<NI, NV, EV> as UndirectedNeighborsWithValues<NI, EV>>::NeighborsIterator<'_>

Returns an iterator of all nodes connected to the given node including the value of the connecting edge.

Auto Trait Implementations§

§

impl<NI, NV, EV> RefUnwindSafe for UndirectedCsrGraph<NI, NV, EV>where EV: RefUnwindSafe, NI: RefUnwindSafe, NV: RefUnwindSafe,

§

impl<NI, NV, EV> Send for UndirectedCsrGraph<NI, NV, EV>where EV: Send, NV: Send,

§

impl<NI, NV, EV> Sync for UndirectedCsrGraph<NI, NV, EV>where EV: Sync, NV: Sync,

§

impl<NI, NV, EV> Unpin for UndirectedCsrGraph<NI, NV, EV>

§

impl<NI, NV, EV> UnwindSafe for UndirectedCsrGraph<NI, NV, EV>where EV: UnwindSafe, NI: UnwindSafe, NV: 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<NI, EV, U> DegreePartitionOp<NI, EV> for Uwhere NI: Idx, U: Graph<NI> + UndirectedDegrees<NI> + UndirectedNeighborsWithValues<NI, EV>,

source§

fn degree_partition(&self, concurrency: usize) -> Vec<Range<NI>>

Creates a greedy range-based degree partition of the nodes.

It is greedy in the sense that it goes through the node set only once and simply adds a new range to the result whenever the current range’s nodes’ degrees sum up to at least the average node degree.

Example
let graph: UndirectedCsrGraph<u32> = GraphBuilder::new()
    .edges(vec![(0, 1), (0, 2), (0, 3), (0, 3)])
    .build();

let partition: Vec<Range<u32>> = graph.degree_partition(2);

assert_eq!(partition.len(), 2);
assert_eq!(partition[0], 0..1);
assert_eq!(partition[1], 1..4);
source§

impl<NI, G> ForEachNodeParallelByPartitionOp<NI> for Gwhere NI: Idx, G: Graph<NI> + Sync,

source§

fn for_each_node_par_by_partition<T, F>( &self, partition: &[Range<NI>], node_values: &mut [T], node_fn: F ) -> Result<(), Error>where T: Send, F: Fn(&G, NI, &mut T) + Send + Sync,

For each node calls a given function with the node and its corresponding mutable state in parallel based on the provided node partition.

The parallelization is done by means of a rayon based fork join with a task for each range in the provided node partition.

source§

impl<NI, G> ForEachNodeParallelOp<NI> for Gwhere NI: Idx, G: Graph<NI> + Sync,

source§

fn for_each_node_par<T, F>( &self, node_values: &mut [T], node_fn: F ) -> Result<(), Error>where T: Send, F: Fn(&G, NI, &mut T) + Send + Sync,

For each node calls a given function with the node and its corresponding mutable state in parallel.

The parallelization is done by means of a rayon based fork join with a task for each node.

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<G, NI, EV> RelabelByDegreeOp<NI, EV> for Gwhere NI: Idx, EV: Copy + Ord + Sync, G: Graph<NI> + UndirectedDegrees<NI> + UndirectedNeighborsWithValues<NI, EV> + SwapCsr<NI, NI, EV> + Sync,

source§

fn make_degree_ordered(&mut self)

Creates a new graph by relabeling the node ids of the given graph. 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.