pub struct SkelGraph { /* private fields */ }
Expand description
A skeletal finite graph with indexed source and target maps.
The data structure is the same as the standard Graph
type in
Catlab.jl.
Implementations§
Source§impl SkelGraph
impl SkelGraph
Sourcepub fn add_vertex(&mut self) -> usize
pub fn add_vertex(&mut self) -> usize
Adds a new vertex to the graph and returns it.
Sourcepub fn add_vertices(&mut self, n: usize) -> Range<usize>
pub fn add_vertices(&mut self, n: usize) -> Range<usize>
Adds n
new vertices to the graphs and returns them.
Trait Implementations§
Source§impl ColumnarGraph for SkelGraph
impl ColumnarGraph for SkelGraph
Source§type Vertices = SkelFinSet
type Vertices = SkelFinSet
The set of vertices.
Source§type Edges = SkelFinSet
type Edges = SkelFinSet
The set of edges.
Source§type Src = SkelIndexedColumn
type Src = SkelIndexedColumn
The map assigning each edge its source vertex.
Source§type Tgt = SkelIndexedColumn
type Tgt = SkelIndexedColumn
The map assigning each edge its target vertex.
Source§fn vertex_set(&self) -> &Self::Vertices
fn vertex_set(&self) -> &Self::Vertices
Gets the set of vertices.
Source§impl FiniteColumnarGraph for SkelGraph
impl FiniteColumnarGraph for SkelGraph
Source§fn iter_invalid(&self) -> impl Iterator<Item = InvalidGraphData<Self::E>>
fn iter_invalid(&self) -> impl Iterator<Item = InvalidGraphData<Self::E>>
Iterates over failures to be a valid graph.
Source§impl MutColumnarGraph for SkelGraph
impl MutColumnarGraph for SkelGraph
Source§fn src_map_mut(&mut self) -> &mut Self::Src
fn src_map_mut(&mut self) -> &mut Self::Src
Variant of
src_map
that returns a mutable
reference.Source§fn tgt_map_mut(&mut self) -> &mut Self::Tgt
fn tgt_map_mut(&mut self) -> &mut Self::Tgt
Variant of
tgt_map
that returns a mutable
reference.Source§impl Validate for SkelGraph
impl Validate for SkelGraph
Source§type ValidationError = InvalidGraphData<usize>
type ValidationError = InvalidGraphData<usize>
The type of a validation error. Read more
impl Eq for SkelGraph
impl StructuralPartialEq for SkelGraph
Auto Trait Implementations§
impl Freeze for SkelGraph
impl RefUnwindSafe for SkelGraph
impl Send for SkelGraph
impl Sync for SkelGraph
impl Unpin for SkelGraph
impl UnwindSafe for SkelGraph
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<G> FinGraph for Gwhere
G: FiniteColumnarGraph,
impl<G> FinGraph for Gwhere
G: FiniteColumnarGraph,
Source§fn vertices(&self) -> impl Iterator<Item = <G as Graph>::V>
fn vertices(&self) -> impl Iterator<Item = <G as Graph>::V>
Iterates over the vertices in the graph.
Source§fn edges(&self) -> impl Iterator<Item = <G as Graph>::E>
fn edges(&self) -> impl Iterator<Item = <G as Graph>::E>
Iterates over the edges in the graph.
Source§fn in_edges(&self, v: &<G as Graph>::V) -> impl Iterator<Item = <G as Graph>::E>
fn in_edges(&self, v: &<G as Graph>::V) -> impl Iterator<Item = <G as Graph>::E>
Iterates over the edges incoming to a vertex. Read more
Source§fn out_edges(
&self,
v: &<G as Graph>::V,
) -> impl Iterator<Item = <G as Graph>::E>
fn out_edges( &self, v: &<G as Graph>::V, ) -> impl Iterator<Item = <G as Graph>::E>
Iterates over the edges outgoing from a vertex. Read more
Source§fn vertex_count(&self) -> usize
fn vertex_count(&self) -> usize
Number of vertices in the graph.
Source§fn edge_count(&self) -> usize
fn edge_count(&self) -> usize
Number of edges in the graph.
Source§fn out_degree(&self, v: &Self::V) -> usize
fn out_degree(&self, v: &Self::V) -> usize
Number of edges outgoing from a vertex.
Source§impl<G> Graph for Gwhere
G: ColumnarGraph,
impl<G> Graph for Gwhere
G: ColumnarGraph,
Source§type V = <G as ColumnarGraph>::V
type V = <G as ColumnarGraph>::V
Type of vertices in graph.
Source§type E = <G as ColumnarGraph>::E
type E = <G as ColumnarGraph>::E
Type of edges in graph.
Source§fn has_vertex(&self, v: &<G as Graph>::V) -> bool
fn has_vertex(&self, v: &<G as Graph>::V) -> bool
Does the graph contain the value as a vertex?
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 more§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.