pub struct UndirectedCsrGraph<NI: Idx, NV = (), EV = ()> { /* private fields */ }Implementations§
Source§impl<NI: Idx, NV, EV> UndirectedCsrGraph<NI, NV, EV>
impl<NI: Idx, NV, EV> UndirectedCsrGraph<NI, NV, EV>
pub fn new(node_values: NodeValues<NV>, csr: Csr<NI, NI, EV>) -> Self
Trait Implementations§
Source§impl<R, NI, NV, EV> DeserializeGraphOp<R, UndirectedCsrGraph<NI, NV, EV>> for UndirectedCsrGraph<NI, NV, EV>
impl<R, NI, NV, EV> DeserializeGraphOp<R, UndirectedCsrGraph<NI, NV, EV>> for UndirectedCsrGraph<NI, NV, EV>
fn deserialize(read: R) -> Result<Self, Error>
Source§impl<'a, NI, NV, EV> From<(&'a Graph, CsrLayout)> for UndirectedCsrGraph<NI, NV, EV>
Available on crate feature gdl only.
impl<'a, NI, NV, EV> From<(&'a Graph, CsrLayout)> for UndirectedCsrGraph<NI, NV, EV>
Available on crate feature
gdl only.Source§impl<NI, Label> From<(DotGraph<NI, Label>, CsrLayout)> for UndirectedCsrGraph<NI, ()>
Available on crate feature dotgraph only.
impl<NI, Label> From<(DotGraph<NI, Label>, CsrLayout)> for UndirectedCsrGraph<NI, ()>
Available on crate feature
dotgraph only.Source§impl<NI, Label> From<(DotGraph<NI, Label>, CsrLayout)> for UndirectedCsrGraph<NI, Label>
Available on crate feature dotgraph only.
impl<NI, Label> From<(DotGraph<NI, Label>, CsrLayout)> for UndirectedCsrGraph<NI, Label>
Available on crate feature
dotgraph only.Source§impl<NI, NV, EV> From<(Graph, CsrLayout)> for UndirectedCsrGraph<NI, NV, EV>
Available on crate feature gdl only.
impl<NI, NV, EV> From<(Graph, CsrLayout)> for UndirectedCsrGraph<NI, NV, EV>
Available on crate feature
gdl only.Source§impl<NI, NV, EV, E> From<(NodeValues<NV>, E, CsrLayout)> for UndirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV, E> From<(NodeValues<NV>, E, CsrLayout)> for UndirectedCsrGraph<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
Converts to this type from the input type.
Source§impl<NI: Idx, NV, EV> Graph<NI> for UndirectedCsrGraph<NI, NV, EV>
impl<NI: Idx, NV, EV> Graph<NI> for UndirectedCsrGraph<NI, NV, EV>
Source§fn node_count(&self) -> NI
fn node_count(&self) -> NI
Returns the number of nodes in the graph.
Source§fn edge_count(&self) -> NI
fn edge_count(&self) -> NI
Returns the number of edges in the graph.
Source§impl<NI: Idx, NV, EV> NodeValues<NI, NV> for UndirectedCsrGraph<NI, NV, EV>
impl<NI: Idx, NV, EV> NodeValues<NI, NV> for UndirectedCsrGraph<NI, NV, EV>
fn node_value(&self, node: NI) -> &NV
Source§impl<W, NI, NV, EV> SerializeGraphOp<W> for UndirectedCsrGraph<NI, NV, EV>
impl<W, NI, NV, EV> SerializeGraphOp<W> for UndirectedCsrGraph<NI, NV, EV>
Source§impl<NI: Idx, NV, EV> SwapCsr<NI, NI, EV> for UndirectedCsrGraph<NI, NV, EV>
impl<NI: Idx, NV, EV> SwapCsr<NI, NI, EV> for UndirectedCsrGraph<NI, NV, EV>
Source§impl<NI: Idx, NV, EV> UndirectedDegrees<NI> for UndirectedCsrGraph<NI, NV, EV>
impl<NI: Idx, NV, EV> UndirectedDegrees<NI> for UndirectedCsrGraph<NI, NV, EV>
Source§impl<NI: Idx, NV> UndirectedNeighbors<NI> for UndirectedCsrGraph<NI, NV>
impl<NI: Idx, NV> UndirectedNeighbors<NI> for UndirectedCsrGraph<NI, NV>
type NeighborsIterator<'a> = Iter<'a, NI> where NV: 'a
Source§fn neighbors(&self, node: NI) -> Self::NeighborsIterator<'_>
fn neighbors(&self, node: NI) -> Self::NeighborsIterator<'_>
Returns an iterator of all nodes connected to the given node.
Source§impl<NI: Idx, NV, EV> UndirectedNeighborsWithValues<NI, EV> for UndirectedCsrGraph<NI, NV, EV>
impl<NI: Idx, NV, EV> UndirectedNeighborsWithValues<NI, EV> for UndirectedCsrGraph<NI, NV, EV>
type NeighborsIterator<'a> = Iter<'a, Target<NI, EV>> where NV: 'a, EV: 'a
Source§fn neighbors_with_values(&self, node: NI) -> Self::NeighborsIterator<'_>
fn neighbors_with_values(&self, node: NI) -> Self::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> Freeze for UndirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV> RefUnwindSafe for UndirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV> Send for UndirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV> Sync for UndirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV> Unpin for UndirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV> UnsafeUnpin for UndirectedCsrGraph<NI, NV, EV>
impl<NI, NV, EV> UnwindSafe for UndirectedCsrGraph<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
Mutably borrows from an owned value. Read more
Source§impl<NI, EV, U> DegreePartitionOp<NI, EV> for U
impl<NI, EV, U> DegreePartitionOp<NI, EV> for U
Source§fn degree_partition(&self, concurrency: usize) -> Vec<Range<NI>>
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 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<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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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,
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)
fn make_degree_ordered(&mut self)
Creates a new graph by relabeling the node ids of the given graph. Read more