Struct falcon::graph::Graph
[−]
[src]
pub struct Graph<V, E> { /* fields omitted */ }
A directed graph.
Methods
impl<V, E> Graph<V, E> where
V: Sync + Vertex,
E: Edge + Sync,
[src]
V: Sync + Vertex,
E: Edge + Sync,
pub fn new() -> Graph<V, E>
[src]
pub fn num_vertices(&self) -> usize
[src]
pub fn has_vertex(&self, index: u64) -> bool
[src]
Returns true if the vertex with the given index exists in this graph
pub fn set_head(&mut self, index: u64) -> Result<()>
[src]
Sets the head of this graph.
pub fn head(&self) -> Option<u64>
[src]
Returns the head of this graph.
pub fn remove_vertex(&mut self, index: u64) -> Result<()>
[src]
Removes a vertex, and all edges associated with that vertex.
pub fn remove_edge(&mut self, head: u64, tail: u64) -> Result<()>
[src]
Removes an edge
pub fn insert_vertex(&mut self, v: V) -> Result<()>
[src]
pub fn insert_edge(&mut self, edge: E) -> Result<()>
[src]
pub fn successors(&self, index: u64) -> Result<Vec<&V>>
[src]
Returns all immediate successors of a vertex from the graph.
pub fn predecessors(&self, index: u64) -> Result<Vec<&V>>
[src]
Returns all immediate predecessors of a vertex from the graph.
pub fn compute_dominance_frontiers(
&self,
start_index: u64
) -> Result<BTreeMap<u64, BTreeSet<u64>>>
[src]
&self,
start_index: u64
) -> Result<BTreeMap<u64, BTreeSet<u64>>>
Computes the dominance frontiers for all vertices in the graph
Warning
Unsure of correctness of this implementation
pub fn compute_immediate_dominators(
&self,
start_index: u64
) -> Result<BTreeMap<u64, u64>>
[src]
&self,
start_index: u64
) -> Result<BTreeMap<u64, u64>>
pub fn compute_dominators(
&self,
start_index: u64
) -> Result<BTreeMap<u64, BTreeSet<u64>>>
[src]
&self,
start_index: u64
) -> Result<BTreeMap<u64, BTreeSet<u64>>>
Computes dominators for all vertices in the graph
pub fn compute_predecessors(&self) -> Result<BTreeMap<u64, BTreeSet<u64>>>
[src]
Computes predecessors for all vertices in the graph
The resulting sets include all predecessors for each vertex in the graph, not just immediate predecessors.
Given A -> B -> C, both A and B will be in the set for C.
pub fn compute_acyclic(
&self,
start_index: u64
) -> Result<Graph<NullVertex, NullEdge>>
[src]
&self,
start_index: u64
) -> Result<Graph<NullVertex, NullEdge>>
Creates an acyclic graph with NullVertex and NullEdge
pub fn vertices(&self) -> Vec<&V>
[src]
Returns all vertices in the graph.
pub fn vertices_mut(&mut self) -> Vec<&mut V>
[src]
pub fn vertex(&self, index: u64) -> Option<&V>
[src]
Fetches an index from the graph by index.
pub fn vertex_mut(&mut self, index: u64) -> Option<&mut V>
[src]
pub fn edge(&self, head: u64, tail: u64) -> Option<&E>
[src]
pub fn edge_mut(&mut self, head: u64, tail: u64) -> Option<&mut E>
[src]
pub fn edges(&self) -> Vec<&E>
[src]
Get a reference to every Edge
in the Graph
.
pub fn edges_mut(&mut self) -> Vec<&mut E>
[src]
Get a mutable reference to every Edge
in the Graph
.
pub fn edges_out(&self, index: u64) -> Option<&Vec<E>>
[src]
Return all edges out for a vertex
pub fn edges_in(&self, index: u64) -> Option<&Vec<E>>
[src]
Return all edges in for a vertex
pub fn dot_graph(&self) -> String
[src]
Returns a string in the graphviz format
Trait Implementations
impl<V: Clone, E: Clone> Clone for Graph<V, E>
[src]
fn clone(&self) -> Graph<V, E>
[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<V: Debug, E: Debug> Debug for Graph<V, E>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<V: Eq, E: Eq> Eq for Graph<V, E>
[src]
impl<V: Hash, E: Hash> Hash for Graph<V, E>
[src]
fn hash<__HVE: Hasher>(&self, __arg_0: &mut __HVE)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<V: Ord, E: Ord> Ord for Graph<V, E>
[src]
fn cmp(&self, __arg_0: &Graph<V, E>) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl<V: PartialEq, E: PartialEq> PartialEq for Graph<V, E>
[src]
fn eq(&self, __arg_0: &Graph<V, E>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Graph<V, E>) -> bool
[src]
This method tests for !=
.
impl<V: PartialOrd, E: PartialOrd> PartialOrd for Graph<V, E>
[src]
fn partial_cmp(&self, __arg_0: &Graph<V, E>) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Graph<V, E>) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Graph<V, E>) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Graph<V, E>) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Graph<V, E>) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more