Struct graphene::core::constraint::UndirectedGraph
[−]
[src]
pub struct UndirectedGraph<G> where
G: ConstrainedGraph,
<G as BaseGraph>::Vertex: Vertex,
<G as BaseGraph>::Weight: Weight,
<<G as BaseGraph>::VertexIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<G as BaseGraph>::EdgeIter as IntoIterator>::IntoIter: ExactSizeIterator, { /* fields omitted */ }
A graph wrapper that enforces the Undirected
constraint on any graph its given.
See <INSERT LINK TO Undirected
> for a complete description.
Trait Implementations
impl<G: Debug> Debug for UndirectedGraph<G> where
G: ConstrainedGraph,
<G as BaseGraph>::Vertex: Vertex,
<G as BaseGraph>::Weight: Weight,
<<G as BaseGraph>::VertexIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<G as BaseGraph>::EdgeIter as IntoIterator>::IntoIter: ExactSizeIterator,
[src]
G: ConstrainedGraph,
<G as BaseGraph>::Vertex: Vertex,
<G as BaseGraph>::Weight: Weight,
<<G as BaseGraph>::VertexIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<G as BaseGraph>::EdgeIter as IntoIterator>::IntoIter: ExactSizeIterator,
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<G: Clone> Clone for UndirectedGraph<G> where
G: ConstrainedGraph,
<G as BaseGraph>::Vertex: Vertex,
<G as BaseGraph>::Weight: Weight,
<<G as BaseGraph>::VertexIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<G as BaseGraph>::EdgeIter as IntoIterator>::IntoIter: ExactSizeIterator,
[src]
G: ConstrainedGraph,
<G as BaseGraph>::Vertex: Vertex,
<G as BaseGraph>::Weight: Weight,
<<G as BaseGraph>::VertexIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<G as BaseGraph>::EdgeIter as IntoIterator>::IntoIter: ExactSizeIterator,
fn clone(&self) -> UndirectedGraph<G>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<G> GraphWrapper for UndirectedGraph<G> where
G: ConstrainedGraph,
<G as BaseGraph>::Vertex: Vertex,
<G as BaseGraph>::Weight: Weight,
<<G as BaseGraph>::VertexIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<G as BaseGraph>::EdgeIter as IntoIterator>::IntoIter: ExactSizeIterator,
[src]
G: ConstrainedGraph,
<G as BaseGraph>::Vertex: Vertex,
<G as BaseGraph>::Weight: Weight,
<<G as BaseGraph>::VertexIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<G as BaseGraph>::EdgeIter as IntoIterator>::IntoIter: ExactSizeIterator,
type Wrapped = G
fn wrap(g: Self::Wrapped) -> Self
[src]
fn wrapped(&self) -> &Self::Wrapped
[src]
fn wrapped_mut(&mut self) -> &mut Self::Wrapped
[src]
fn unwrap(self) -> Self::Wrapped
[src]
impl<G> Undirected for UndirectedGraph<G> where
G: ConstrainedGraph,
<G as BaseGraph>::Vertex: Vertex,
<G as BaseGraph>::Weight: Weight,
<<G as BaseGraph>::VertexIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<G as BaseGraph>::EdgeIter as IntoIterator>::IntoIter: ExactSizeIterator,
[src]
G: ConstrainedGraph,
<G as BaseGraph>::Vertex: Vertex,
<G as BaseGraph>::Weight: Weight,
<<G as BaseGraph>::VertexIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<G as BaseGraph>::EdgeIter as IntoIterator>::IntoIter: ExactSizeIterator,
impl<G> BaseGraph for UndirectedGraph<G> where
G: ConstrainedGraph,
<G as BaseGraph>::Vertex: Vertex,
<G as BaseGraph>::Weight: Weight,
<<G as BaseGraph>::VertexIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<G as BaseGraph>::EdgeIter as IntoIterator>::IntoIter: ExactSizeIterator,
[src]
G: ConstrainedGraph,
<G as BaseGraph>::Vertex: Vertex,
<G as BaseGraph>::Weight: Weight,
<<G as BaseGraph>::VertexIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<G as BaseGraph>::EdgeIter as IntoIterator>::IntoIter: ExactSizeIterator,
type Vertex = <G as BaseGraph>::Vertex
Type of the vertices in the graph.
type Weight = <G as BaseGraph>::Weight
Type of the weights in the graph.
type VertexIter = <G as BaseGraph>::VertexIter
Type of the collection returned with vertices.
type EdgeIter = <G as BaseGraph>::EdgeIter
Type of the collection returned with edges.
fn empty_graph() -> Self
[src]
Creates an empty graph. I.e a graph with no vertices and no edges. Read more
fn all_vertices(&self) -> Self::VertexIter
[src]
Returns copies of all current vertices in the graph. Read more
fn all_edges(&self) -> Self::EdgeIter
[src]
Returns copies of all current edges in the graph. Read more
fn add_vertex(&mut self, v: Self::Vertex) -> Result<(), ()>
[src]
Adds the given vertex to graph as long as no equal vertex is already present i the graph and the graph is capable of storing it. Read more
fn remove_vertex(&mut self, v: Self::Vertex) -> Result<(), ()>
[src]
Removes the given vertex from the graph, assuming it is present. Read more
fn add_edge(
&mut self,
e: BaseEdge<Self::Vertex, Self::Weight>
) -> Result<(), ()>
[src]
&mut self,
e: BaseEdge<Self::Vertex, Self::Weight>
) -> Result<(), ()>
Adds the given edge to the graph assuming it connects to valid vertices. Read more
fn remove_edge(
&mut self,
e: BaseEdge<Self::Vertex, Self::Weight>
) -> Result<(), ()>
[src]
&mut self,
e: BaseEdge<Self::Vertex, Self::Weight>
) -> Result<(), ()>
Removes the given edge from the graph, assuming it is already present. Read more
fn vertex_count(&self) -> usize
[src]
Returns the number of vertices in the graph. Read more
fn edge_count(&self) -> usize
[src]
Returns the number of edges in the graph. Read more
fn graph(
vertices: Vec<Self::Vertex>,
edges: Vec<(Self::Vertex, Self::Vertex, Self::Weight)>
) -> Result<Self, ()> where
Self: Sized,
[src]
vertices: Vec<Self::Vertex>,
edges: Vec<(Self::Vertex, Self::Vertex, Self::Weight)>
) -> Result<Self, ()> where
Self: Sized,
Creates a graph containing the given vertices and edges. There can be no duplicate vertices and all edges must connect to the given vertices. Read more
fn edges_between(&self, v1: Self::Vertex, v2: Self::Vertex) -> Self::EdgeIter
[src]
Returns all edges that are connect to both the given vertices. Read more
fn edges_sourced_in(&self, v: Self::Vertex) -> Self::EdgeIter
[src]
Returns all edges that are sourced in the given vertex. Read more
fn edges_sinked_in(&self, v: Self::Vertex) -> Self::EdgeIter
[src]
Returns all edges that are sinked in the given vertex. Read more
impl<G> ConstrainedGraph for UndirectedGraph<G> where
G: ConstrainedGraph,
<G as BaseGraph>::Vertex: Vertex,
<G as BaseGraph>::Weight: Weight,
<<G as BaseGraph>::VertexIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<G as BaseGraph>::EdgeIter as IntoIterator>::IntoIter: ExactSizeIterator,
[src]
G: ConstrainedGraph,
<G as BaseGraph>::Vertex: Vertex,
<G as BaseGraph>::Weight: Weight,
<<G as BaseGraph>::VertexIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<G as BaseGraph>::EdgeIter as IntoIterator>::IntoIter: ExactSizeIterator,
fn invariant_holds(&self) -> bool
[src]
Checks whether the current state of the graph upholds the constraint invariant. Read more
unsafe fn uncon_add_vertex(&mut self, v: Self::Vertex) -> Result<(), ()>
[src]
Adds the given vertex to the graph without upholding the constraint invariant. Read more
unsafe fn uncon_remove_vertex(&mut self, v: Self::Vertex) -> Result<(), ()>
[src]
Removes the given vertex from the graph without upholding the constraint invariant. Read more
unsafe fn uncon_add_edge(
&mut self,
e: BaseEdge<Self::Vertex, Self::Weight>
) -> Result<(), ()>
[src]
&mut self,
e: BaseEdge<Self::Vertex, Self::Weight>
) -> Result<(), ()>
Adds the given edge to the graph without upholding the constraint invariant. Read more
unsafe fn uncon_remove_edge(
&mut self,
e: BaseEdge<Self::Vertex, Self::Weight>
) -> Result<(), ()>
[src]
&mut self,
e: BaseEdge<Self::Vertex, Self::Weight>
) -> Result<(), ()>
Removes the given edge from the graph without upholding the constraint invariant. Read more
fn unconstrained<'a>(
&'a mut self
) -> Unconstrainer<Self::Vertex, Self::Weight, Self::VertexIter, Self::EdgeIter, Self>
[src]
&'a mut self
) -> Unconstrainer<Self::Vertex, Self::Weight, Self::VertexIter, Self::EdgeIter, Self>
Returns an Unconstrainer
connected to the graph. Read more
Auto Trait Implementations
impl<G> Send for UndirectedGraph<G> where
G: Send,
G: Send,
impl<G> Sync for UndirectedGraph<G> where
G: Sync,
G: Sync,