pub struct DirectedCsrGraph<NI: Idx, NV = (), EV = ()> { /* private fields */ }Implementations§
Source§impl<NI: Idx, NV, EV> DirectedCsrGraph<NI, NV, EV>
impl<NI: Idx, NV, EV> DirectedCsrGraph<NI, NV, EV>
pub fn new( node_values: NodeValues<NV>, csr_out: Csr<NI, NI, EV>, csr_inc: Csr<NI, NI, EV>, ) -> Self
Trait Implementations§
Source§impl<R, NI, NV, EV> DeserializeGraphOp<R, DirectedCsrGraph<NI, NV, EV>> for DirectedCsrGraph<NI, NV, EV>
impl<R, NI, NV, EV> DeserializeGraphOp<R, DirectedCsrGraph<NI, NV, EV>> for DirectedCsrGraph<NI, NV, EV>
fn deserialize(read: R) -> Result<Self, Error>
Source§impl<NI: Idx, NV, EV> DirectedDegrees<NI> for DirectedCsrGraph<NI, NV, EV>
impl<NI: Idx, NV, EV> DirectedDegrees<NI> for DirectedCsrGraph<NI, NV, EV>
Source§impl<NI: Idx, NV> DirectedNeighbors<NI> for DirectedCsrGraph<NI, NV, ()>
impl<NI: Idx, NV> DirectedNeighbors<NI> for DirectedCsrGraph<NI, NV, ()>
type NeighborsIterator<'a> = Iter<'a, NI> where NV: 'a
Source§fn out_neighbors(&self, node: NI) -> Self::NeighborsIterator<'_>
fn out_neighbors(&self, node: NI) -> Self::NeighborsIterator<'_>
Source§fn in_neighbors(&self, node: NI) -> Self::NeighborsIterator<'_>
fn in_neighbors(&self, node: NI) -> Self::NeighborsIterator<'_>
Source§impl<NI: Idx, NV, EV> DirectedNeighborsWithValues<NI, EV> for DirectedCsrGraph<NI, NV, EV>
impl<NI: Idx, NV, EV> DirectedNeighborsWithValues<NI, EV> for DirectedCsrGraph<NI, NV, EV>
type NeighborsIterator<'a> = Iter<'a, Target<NI, EV>> where NV: 'a, EV: 'a
Source§fn out_neighbors_with_values(&self, node: NI) -> Self::NeighborsIterator<'_>
fn out_neighbors_with_values(&self, node: NI) -> Self::NeighborsIterator<'_>
Source§fn in_neighbors_with_values(&self, node: NI) -> Self::NeighborsIterator<'_>
fn in_neighbors_with_values(&self, node: NI) -> Self::NeighborsIterator<'_>
Source§impl<'a, NI, NV, EV> From<(&'a Graph, CsrLayout)> for DirectedCsrGraph<NI, NV, EV>
Available on crate feature gdl only.
impl<'a, NI, NV, EV> From<(&'a Graph, CsrLayout)> for DirectedCsrGraph<NI, NV, EV>
gdl only.Source§impl<NI, Label> From<(DotGraph<NI, Label>, CsrLayout)> for DirectedCsrGraph<NI, ()>
Available on crate feature dotgraph only.
impl<NI, Label> From<(DotGraph<NI, Label>, CsrLayout)> for DirectedCsrGraph<NI, ()>
dotgraph only.Source§impl<NI, Label> From<(DotGraph<NI, Label>, CsrLayout)> for DirectedCsrGraph<NI, Label>
Available on crate feature dotgraph only.
impl<NI, Label> From<(DotGraph<NI, Label>, CsrLayout)> for DirectedCsrGraph<NI, Label>
dotgraph only.Source§impl<NI, NV, EV> From<(Graph, CsrLayout)> for DirectedCsrGraph<NI, NV, EV>
Available on crate feature gdl only.
impl<NI, NV, EV> From<(Graph, CsrLayout)> for DirectedCsrGraph<NI, NV, EV>
gdl only.Source§impl<NI, NV, EV, E> From<(NodeValues<NV>, E, CsrLayout)> for DirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV, E> From<(NodeValues<NV>, E, CsrLayout)> for DirectedCsrGraph<NI, NV, EV>
Source§fn from(
(node_values, edge_list, csr_option): (NodeValues<NV>, E, CsrLayout),
) -> Self
fn from( (node_values, edge_list, csr_option): (NodeValues<NV>, E, CsrLayout), ) -> Self
Source§impl<NI: Idx, NV, EV> Graph<NI> for DirectedCsrGraph<NI, NV, EV>
impl<NI: Idx, NV, EV> Graph<NI> for DirectedCsrGraph<NI, NV, EV>
Source§fn node_count(&self) -> NI
fn node_count(&self) -> NI
Source§fn edge_count(&self) -> NI
fn edge_count(&self) -> NI
Source§impl<NI: Idx, NV, EV> NodeValues<NI, NV> for DirectedCsrGraph<NI, NV, EV>
impl<NI: Idx, NV, EV> NodeValues<NI, NV> for DirectedCsrGraph<NI, NV, EV>
fn node_value(&self, node: NI) -> &NV
Source§impl<W, NI, NV, EV> SerializeGraphOp<W> for DirectedCsrGraph<NI, NV, EV>
impl<W, NI, NV, EV> SerializeGraphOp<W> for DirectedCsrGraph<NI, NV, EV>
Source§impl<NI, NV, EV> ToUndirectedOp for DirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV> ToUndirectedOp for DirectedCsrGraph<NI, NV, EV>
type Undirected = UndirectedCsrGraph<NI, NV, EV>
Source§fn to_undirected(
&self,
layout: impl Into<Option<CsrLayout>>,
) -> Self::Undirected
fn to_undirected( &self, layout: impl Into<Option<CsrLayout>>, ) -> Self::Undirected
Auto Trait Implementations§
impl<NI, NV, EV> Freeze for DirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV> RefUnwindSafe for DirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV> Send for DirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV> Sync for DirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV> Unpin for DirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV> UnsafeUnpin for DirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV> UnwindSafe for DirectedCsrGraph<NI, NV, EV>
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
Source§impl<NI, G> ForEachNodeParallelByPartitionOp<NI> for G
impl<NI, G> ForEachNodeParallelByPartitionOp<NI> for G
Source§fn for_each_node_par_by_partition<T, F>(
&self,
partition: &[Range<NI>],
node_values: &mut [T],
node_fn: F,
) -> Result<(), Error>
fn for_each_node_par_by_partition<T, F>( &self, partition: &[Range<NI>], node_values: &mut [T], node_fn: F, ) -> Result<(), Error>
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 G
impl<NI, G> ForEachNodeParallelOp<NI> for G
Source§impl<NI, EV, D> InDegreePartitionOp<NI, EV> for D
impl<NI, EV, D> InDegreePartitionOp<NI, EV> for D
Source§fn in_degree_partition(&self, concurrency: usize) -> Vec<Range<NI>>
fn in_degree_partition(&self, concurrency: usize) -> Vec<Range<NI>>
Creates a greedy range-based in 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’ in degrees sum up to at least the average node in degree.
§Example
let graph: DirectedCsrGraph<u32> = GraphBuilder::new()
.edges(vec![(1, 0), (1, 2), (2, 0), (3, 2)])
.build();
let partition: Vec<Range<u32>> = graph.in_degree_partition(2);
assert_eq!(partition.len(), 2);
assert_eq!(partition[0], 0..1);
assert_eq!(partition[1], 1..4);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>
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>
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 moreSource§impl<NI, EV, D> OutDegreePartitionOp<NI, EV> for D
impl<NI, EV, D> OutDegreePartitionOp<NI, EV> for D
Source§fn out_degree_partition(&self, concurrency: usize) -> Vec<Range<NI>>
fn out_degree_partition(&self, concurrency: usize) -> Vec<Range<NI>>
Creates a greedy range-based out 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’ out degrees sum up to at least the average node out degree.
§Example
let graph: DirectedCsrGraph<u32> = GraphBuilder::new()
.edges(vec![(0, 1), (0, 2), (2, 1), (2, 3)])
.build();
let partition: Vec<Range<u32>> = graph.out_degree_partition(2);
assert_eq!(partition.len(), 2);
assert_eq!(partition[0], 0..1);
assert_eq!(partition[1], 1..4);