Struct graph::prelude::DirectedCsrGraph
source[−]Implementations
pub fn new(
node_values: NodeValues<NV>,
csr_out: Csr<NI, NI, EV>,
csr_inc: Csr<NI, NI, EV>
) -> DirectedCsrGraph<NI, NV, EV>
Trait Implementations
impl<R, NI, NV, EV> DeserializeGraphOp<R, DirectedCsrGraph<NI, NV, EV>> for DirectedCsrGraph<NI, NV, EV> where
R: Read,
NI: Idx + ToMutByteSlice,
NV: ToMutByteSlice,
EV: ToMutByteSlice,
impl<R, NI, NV, EV> DeserializeGraphOp<R, DirectedCsrGraph<NI, NV, EV>> for DirectedCsrGraph<NI, NV, EV> where
R: Read,
NI: Idx + ToMutByteSlice,
NV: ToMutByteSlice,
EV: ToMutByteSlice,
Returns the number of edges where the given node is a source node.
Returns a slice of all nodes which are connected in outgoing direction to the given node, i.e., the given node is the source node of the connecting edge. Read more
impl<NI, NV, EV> DirectedNeighborsWithValues<NI, EV> for DirectedCsrGraph<NI, NV, EV> where
NI: Idx,
impl<NI, NV, EV> DirectedNeighborsWithValues<NI, EV> for DirectedCsrGraph<NI, NV, EV> where
NI: Idx,
Returns a slice of all nodes which are connected in outgoing direction to the given node, i.e., the given node is the source node of the connecting edge. Read more
Performs the conversion.
Returns the number of nodes in the graph.
Returns the number of edges in the graph.
impl<W, NI, NV, EV> SerializeGraphOp<W> for DirectedCsrGraph<NI, NV, EV> where
W: Write,
NI: Idx + ToByteSlice,
NV: ToByteSlice,
EV: ToByteSlice,
impl<W, NI, NV, EV> SerializeGraphOp<W> for DirectedCsrGraph<NI, NV, EV> where
W: Write,
NI: Idx + ToByteSlice,
NV: ToByteSlice,
EV: ToByteSlice,
Auto Trait Implementations
impl<NI, NV, EV> RefUnwindSafe for DirectedCsrGraph<NI, NV, EV> where
EV: RefUnwindSafe,
NI: RefUnwindSafe,
NV: RefUnwindSafe,
impl<NI, NV, EV> Send for DirectedCsrGraph<NI, NV, EV> where
EV: Send,
NV: Send,
impl<NI, NV, EV> Sync for DirectedCsrGraph<NI, NV, EV> where
EV: Sync,
NV: Sync,
impl<NI, NV, EV> Unpin for DirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV> UnwindSafe for DirectedCsrGraph<NI, NV, EV> where
EV: UnwindSafe,
NI: UnwindSafe,
NV: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
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.
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.
impl<NI, EV, D> InDegreePartitionOp<NI, EV> for D where
NI: Idx,
D: Graph<NI> + DirectedDegrees<NI> + DirectedNeighborsWithValues<NI, EV>,
impl<NI, EV, D> InDegreePartitionOp<NI, EV> for D where
NI: Idx,
D: Graph<NI> + DirectedDegrees<NI> + DirectedNeighborsWithValues<NI, EV>,
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);
impl<NI, EV, D> OutDegreePartitionOp<NI, EV> for D where
NI: Idx,
D: Graph<NI> + DirectedDegrees<NI> + DirectedNeighborsWithValues<NI, EV>,
impl<NI, EV, D> OutDegreePartitionOp<NI, EV> for D where
NI: Idx,
D: Graph<NI> + DirectedDegrees<NI> + DirectedNeighborsWithValues<NI, EV>,
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);