Struct fera_graph::graphs::static_::Static
source · pub struct Static<V: Num, K: StaticEdgeKind> { /* private fields */ }
Trait Implementations
sourceimpl<V: Num, K: StaticEdgeKind> Adjacency for Static<V, K>
impl<V: Num, K: StaticEdgeKind> Adjacency for Static<V, K>
fn out_neighbors(&self, v: Vertex<Self>) -> OutNeighborIter<'_, Self>
fn out_degree(&self, v: Vertex<Self>) -> usize
sourceimpl<V: Num, K: StaticEdgeKind> Choose for Static<V, K>
impl<V: Num, K: StaticEdgeKind> Choose for Static<V, K>
sourcefn choose_vertex<R: Rng>(&self, rng: R) -> Option<Vertex<Self>>
fn choose_vertex<R: Rng>(&self, rng: R) -> Option<Vertex<Self>>
Returns a random vertex of this graph or
None
if the graph has no vertices.sourcefn choose_out_neighbor<R: Rng>(
&self,
v: Vertex<Self>,
rng: R
) -> Option<Vertex<Self>>
fn choose_out_neighbor<R: Rng>(
&self,
v: Vertex<Self>,
rng: R
) -> Option<Vertex<Self>>
Returns a random neighbor vertex of
v
or None
if v
has no neighbors.sourcefn choose_edge<R: Rng>(&self, rng: R) -> Option<Edge<Self>>
fn choose_edge<R: Rng>(&self, rng: R) -> Option<Edge<Self>>
Returns a random edge of this graph or
None
if the graph has no edges.sourcefn choose_out_edge<R: Rng>(&self, v: Vertex<Self>, rng: R) -> Option<Edge<Self>>
fn choose_out_edge<R: Rng>(&self, v: Vertex<Self>, rng: R) -> Option<Edge<Self>>
Returns a random out edge of
v
or None
if v
has no out edges.sourcefn choose_vertex_iter<R: Rng>(&self, rng: R) -> ChooseVertexIter<'_, Self, R> ⓘ
fn choose_vertex_iter<R: Rng>(&self, rng: R) -> ChooseVertexIter<'_, Self, R> ⓘ
Returns an iterator that repeatedly calls
choose_vertex
.sourcefn choose_out_neighbor_iter<R: Rng>(
&self,
v: Vertex<Self>,
rng: R
) -> ChooseOutNeighborIter<'_, Self, R> ⓘ
fn choose_out_neighbor_iter<R: Rng>(
&self,
v: Vertex<Self>,
rng: R
) -> ChooseOutNeighborIter<'_, Self, R> ⓘ
Returns an iterator that repeatedly calls
choose_out_neighbor(v)
.sourcefn choose_edge_iter<R: Rng>(&self, rng: R) -> ChooseEdgeIter<'_, Self, R> ⓘ
fn choose_edge_iter<R: Rng>(&self, rng: R) -> ChooseEdgeIter<'_, Self, R> ⓘ
Returns an iterator that repeatedly calls
choose_edge
.sourcefn choose_out_edge_iter<R: Rng>(
&self,
v: Vertex<Self>,
rng: R
) -> ChooseOutEdgeIter<'_, Self, R> ⓘ
fn choose_out_edge_iter<R: Rng>(
&self,
v: Vertex<Self>,
rng: R
) -> ChooseOutEdgeIter<'_, Self, R> ⓘ
Returns an iterator that repeatedly calls
choose_out_edge(v)
.sourcefn random_walk<R: Rng>(&self, rng: R) -> RandomWalk<'_, Self, R> ⓘ
fn random_walk<R: Rng>(&self, rng: R) -> RandomWalk<'_, Self, R> ⓘ
Returns a iterator that produces a sequence of random edges that forms a walk, that is, the
target vertex of the previous edge is the source vertex of the next edge. Read more
sourceimpl<V: Num, K: StaticEdgeKind> EdgeList for Static<V, K>
impl<V: Num, K: StaticEdgeKind> EdgeList for Static<V, K>
fn num_edges(&self) -> usize
fn edges(&self) -> EdgeIter<'_, Self>
fn get_edge_by_ends(&self, u: Vertex<Self>, v: Vertex<Self>) -> Option<Edge<Self>>
fn edges_ends(&self) -> EdgesEnds<'_, Self, EdgeIter<'_, Self>> ⓘ
fn edges_with_ends(&self) -> EdgesWithEnds<'_, Self, EdgeIter<'_, Self>> ⓘ
fn edge_by_ends(&self, u: Vertex<Self>, v: Vertex<Self>) -> Edge<Self>
sourceimpl<V: Num, K: StaticEdgeKind> Incidence for Static<V, K>
impl<V: Num, K: StaticEdgeKind> Incidence for Static<V, K>
fn out_edges(&self, v: Vertex<Self>) -> OutEdgeIter<'_, Self>
fn out_edges_ends(
&self,
v: Vertex<Self>
) -> EdgesEnds<'_, Self, OutEdgeIter<'_, Self>> ⓘ
fn out_edges_with_ends(
&self,
v: Vertex<Self>
) -> EdgesWithEnds<'_, Self, OutEdgeIter<'_, Self>> ⓘ
sourceimpl<V: PartialEq + Num, K: PartialEq + StaticEdgeKind> PartialEq<Static<V, K>> for Static<V, K>where
K::Edge: PartialEq,
impl<V: PartialEq + Num, K: PartialEq + StaticEdgeKind> PartialEq<Static<V, K>> for Static<V, K>where
K::Edge: PartialEq,
sourceimpl<V: Num, K: StaticEdgeKind> VertexList for Static<V, K>
impl<V: Num, K: StaticEdgeKind> VertexList for Static<V, K>
fn num_vertices(&self) -> usize
fn vertices(&self) -> VertexIter<'_, Self>
sourceimpl<'a, V: Num, K: StaticEdgeKind> VertexTypes<'a, Static<V, K>> for Static<V, K>
impl<'a, V: Num, K: StaticEdgeKind> VertexTypes<'a, Static<V, K>> for Static<V, K>
type VertexIter = <V as Num>::Range
type OutNeighborIter = OutNeighborFromOutEdge<'a, Static<V, K>, <Static<V, K> as EdgeTypes<'a, Static<V, K>>>::OutEdgeIter>
sourceimpl<V: Num, K: StaticEdgeKind> WithBuilder for Static<V, K>
impl<V: Num, K: StaticEdgeKind> WithBuilder for Static<V, K>
type Builder = StaticBuilder<V, K>
type Builder = StaticBuilder<V, K>
The builder for this graph type.
sourcefn builder(num_vertices: usize, num_edges: usize) -> Self::Builder
fn builder(num_vertices: usize, num_edges: usize) -> Self::Builder
Creates a new builder for a graph of this type with
n
vertices and initial capacity for
m
edges. Read moresourcefn new_with_edges<I>(n: usize, edges: I) -> Selfwhere
I: IntoIterator<Item = (usize, usize)>,
fn new_with_edges<I>(n: usize, edges: I) -> Selfwhere
I: IntoIterator<Item = (usize, usize)>,
sourcefn new_random_tree<R: Rng>(n: usize, rng: R) -> Self
fn new_random_tree<R: Rng>(n: usize, rng: R) -> Self
Creates a graph with
n
vertices that is a tree, that is, is connected and acyclic. Read moresourceimpl<V: Num, K: StaticEdgeKind> WithEdge for Static<V, K>
impl<V: Num, K: StaticEdgeKind> WithEdge for Static<V, K>
type Kind = <K as StaticEdgeKind>::Kind
type Edge = <K as StaticEdgeKind>::Edge
type OptionEdge = Optioned<<Static<V, K> as WithEdge>::Edge, MaxNone<<Static<V, K> as WithEdge>::Edge>>
fn orientation(&self, _e: Edge<Self>) -> Orientation
fn source(&self, e: Edge<Self>) -> Vertex<Self>
fn target(&self, e: Edge<Self>) -> Vertex<Self>
fn get_reverse(&self, e: Edge<Self>) -> Option<Edge<Self>>
fn ends<'a, I, O>(&'a self, item: I) -> Owhere
I: Ends<'a, Self, O>,
fn end_vertices(&self, e: Edge<Self>) -> (Vertex<Self>, Vertex<Self>)
fn with_ends<I>(&self, iter: I) -> EdgesWithEnds<'_, Self, I::IntoIter> ⓘwhere
I: IntoIterator,
I::Item: IntoOwned<Edge<Self>>,
fn opposite(&self, u: Vertex<Self>, e: Edge<Self>) -> Vertex<Self>
fn is_incident(&self, v: Vertex<Self>, e: Edge<Self>) -> bool
fn edge_none() -> OptionEdge<Self>
fn edge_some(e: Edge<Self>) -> OptionEdge<Self>
fn edge_prop<P, T>(&self, value: T) -> Pwhere
P: EdgePropMutNew<Self, T>,
T: Clone,
fn edge_prop_from_fn<P, F, T>(&self, fun: F) -> Pwhere
Self: EdgeList,
P: EdgePropMutNew<Self, T>,
F: FnMut(Edge<Self>) -> T,
T: Default + Clone,
sourceimpl<V: Num, K: StaticEdgeKind> WithEdgeIndexProp for Static<V, K>
impl<V: Num, K: StaticEdgeKind> WithEdgeIndexProp for Static<V, K>
type EdgeIndexProp = SEdgeIndexProp<K>
sourcefn edge_index(&self) -> EdgeIndexProp<Self>
fn edge_index(&self) -> EdgeIndexProp<Self>
Creates an edge index map.
sourceimpl<T, V: Num, K: StaticEdgeKind> WithEdgeProp<T> for Static<V, K>
impl<T, V: Num, K: StaticEdgeKind> WithEdgeProp<T> for Static<V, K>
type EdgeProp = ArrayProp<<Static<V, K> as WithEdgeIndexProp>::EdgeIndexProp, Vec<T, Global>>
sourceimpl<V: Num, K: StaticEdgeKind> WithVertex for Static<V, K>
impl<V: Num, K: StaticEdgeKind> WithVertex for Static<V, K>
type Vertex = V
type OptionVertex = Optioned<V, MaxNone<V>>
fn vertex_none() -> OptionVertex<Self>
fn vertex_some(v: Vertex<Self>) -> OptionVertex<Self>
fn vertex_prop<P, T>(&self, value: T) -> Pwhere
P: VertexPropMutNew<Self, T>,
T: Clone,
fn vertex_prop_from_fn<P, T, F>(&self, fun: F) -> Pwhere
Self: VertexList,
P: VertexPropMutNew<Self, T>,
F: FnMut(Vertex<Self>) -> T,
T: Default + Clone,
sourceimpl<V: Num, K: StaticEdgeKind> WithVertexIndexProp for Static<V, K>
impl<V: Num, K: StaticEdgeKind> WithVertexIndexProp for Static<V, K>
type VertexIndexProp = SVertexIndexProp
sourcefn vertex_index(&self) -> VertexIndexProp<Self>
fn vertex_index(&self) -> VertexIndexProp<Self>
Creates an vertex index map.
sourceimpl<T, V: Num, K: StaticEdgeKind> WithVertexProp<T> for Static<V, K>
impl<T, V: Num, K: StaticEdgeKind> WithVertexProp<T> for Static<V, K>
type VertexProp = ArrayProp<<Static<V, K> as WithVertexIndexProp>::VertexIndexProp, Vec<T, Global>>
type VertexProp = ArrayProp<<Static<V, K> as WithVertexIndexProp>::VertexIndexProp, Vec<T, Global>>
The vertex property type.
impl<V: Num, K: StaticEdgeKind> BasicEdgeProps for Static<V, K>
impl<V: Num, K: StaticEdgeKind> BasicProps for Static<V, K>
impl<V: Num, K: StaticEdgeKind> BasicVertexProps for Static<V, K>
impl<V: Num, K: StaticEdgeKind> StructuralPartialEq for Static<V, K>
Auto Trait Implementations
impl<V, K> RefUnwindSafe for Static<V, K>where
V: RefUnwindSafe,
<K as StaticEdgeKind>::Edge: RefUnwindSafe,
impl<V, K> Send for Static<V, K>where
V: Send,
<K as StaticEdgeKind>::Edge: Send,
impl<V, K> Sync for Static<V, K>where
V: Sync,
<K as StaticEdgeKind>::Edge: Sync,
impl<V, K> Unpin for Static<V, K>where
V: Unpin,
<K as StaticEdgeKind>::Edge: Unpin,
impl<V, K> UnwindSafe for Static<V, K>where
V: UnwindSafe,
<K as StaticEdgeKind>::Edge: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more