[−][src]Struct bigraph::NodeBigraphWrapper
Wrapper for a static graph that adds a binode mapping function.
Bigraphs can be represented with this struct by creating their topology as normal directed graph where each binode is split into its two parts. The binode mapping function then associates the parts with each other.
use bigraph::node_bigraph_wrapper::NodeBigraphWrapper; use bigraph::{StaticBigraph, MutableGraphContainer, StaticBigraphFromDigraph}; use bigraph::petgraph_impl; let mut graph = petgraph_impl::new(); let n1 = graph.add_node(0); let n2 = graph.add_node(1); graph.add_edge(n1.clone(), n2.clone(), ()); graph.add_edge(n2.clone(), n1.clone(), ()); let bigraph = NodeBigraphWrapper::new(graph, |n| if n % 2 == 0 {n + 1} else {n - 1}); assert_eq!(Some(n2.clone()), bigraph.partner_node(n1.clone())); assert_eq!(Some(n1.clone()), bigraph.partner_node(n2.clone()));
Fields
topology: Topology
Trait Implementations
impl<Topology: Debug + GraphBase> Debug for NodeBigraphWrapper<Topology> where
Topology::OptionalNodeIndex: Debug,
[src]
Topology::OptionalNodeIndex: Debug,
impl<Topology: Default + GraphBase> Default for NodeBigraphWrapper<Topology>
[src]
impl<Topology: DynamicGraph> DynamicBigraph for NodeBigraphWrapper<Topology> where
Self::NodeData: BidirectedNodeData,
Self::EdgeData: Clone,
[src]
Self::NodeData: BidirectedNodeData,
Self::EdgeData: Clone,
fn add_partner_nodes(&mut self)
[src]
fn add_mirror_edges(&mut self)
[src]
impl<'a, Topology: GraphBase> GraphBase for NodeBigraphWrapper<Topology>
[src]
type NodeData = Topology::NodeData
type EdgeData = Topology::EdgeData
type OptionalNodeIndex = Topology::OptionalNodeIndex
type OptionalEdgeIndex = Topology::OptionalEdgeIndex
type NodeIndex = Topology::NodeIndex
type EdgeIndex = Topology::EdgeIndex
impl<Topology: ImmutableGraphContainer> ImmutableGraphContainer for NodeBigraphWrapper<Topology>
[src]
fn node_indices(&self) -> GraphIndices<Self::NodeIndex, Self::OptionalNodeIndex>ⓘImportant traits for GraphIndices<IndexType, OptionalIndexType>
impl<OptionalIndexType, IndexType> Iterator for GraphIndices<IndexType, OptionalIndexType> where
IndexType: GraphIndex<OptionalIndexType>,
OptionalIndexType: OptionalGraphIndex<IndexType>, type Item = IndexType;
[src]
Important traits for GraphIndices<IndexType, OptionalIndexType>
impl<OptionalIndexType, IndexType> Iterator for GraphIndices<IndexType, OptionalIndexType> where
IndexType: GraphIndex<OptionalIndexType>,
OptionalIndexType: OptionalGraphIndex<IndexType>, type Item = IndexType;
fn edge_indices(&self) -> GraphIndices<Self::EdgeIndex, Self::OptionalEdgeIndex>ⓘImportant traits for GraphIndices<IndexType, OptionalIndexType>
impl<OptionalIndexType, IndexType> Iterator for GraphIndices<IndexType, OptionalIndexType> where
IndexType: GraphIndex<OptionalIndexType>,
OptionalIndexType: OptionalGraphIndex<IndexType>, type Item = IndexType;
[src]
Important traits for GraphIndices<IndexType, OptionalIndexType>
impl<OptionalIndexType, IndexType> Iterator for GraphIndices<IndexType, OptionalIndexType> where
IndexType: GraphIndex<OptionalIndexType>,
OptionalIndexType: OptionalGraphIndex<IndexType>, type Item = IndexType;
fn contains_node_index(&self, node_index: Self::NodeIndex) -> bool
[src]
fn contains_edge_index(&self, edge_index: Self::EdgeIndex) -> bool
[src]
fn node_count(&self) -> usize
[src]
fn edge_count(&self) -> usize
[src]
fn node_data(&self, node_id: Self::NodeIndex) -> &Self::NodeData
[src]
fn edge_data(&self, edge_id: Self::EdgeIndex) -> &Self::EdgeData
[src]
fn node_data_mut(&mut self, node_id: Self::NodeIndex) -> &mut Self::NodeData
[src]
fn edge_data_mut(&mut self, edge_id: Self::EdgeIndex) -> &mut Self::EdgeData
[src]
fn contains_edge(&self, from: Self::NodeIndex, to: Self::NodeIndex) -> bool
[src]
fn is_empty(&self) -> bool
[src]
impl<Topology: MutableGraphContainer + StaticGraph> MutableGraphContainer for NodeBigraphWrapper<Topology>
[src]
fn add_node(&mut self, node_data: Self::NodeData) -> Self::NodeIndex
[src]
fn add_edge(
&mut self,
from: Self::NodeIndex,
to: Self::NodeIndex,
edge_data: Self::EdgeData
) -> Self::EdgeIndex
[src]
&mut self,
from: Self::NodeIndex,
to: Self::NodeIndex,
edge_data: Self::EdgeData
) -> Self::EdgeIndex
fn remove_node(&mut self, node_id: Self::NodeIndex) -> Option<Self::NodeData>
[src]
fn remove_edge(&mut self, edge_id: Self::EdgeIndex) -> Option<Self::EdgeData>
[src]
impl<'a, Topology: NavigableGraph<'a>> NavigableGraph<'a> for NodeBigraphWrapper<Topology>
[src]
type OutNeighbors = <Topology as NavigableGraph<'a>>::OutNeighbors
type InNeighbors = <Topology as NavigableGraph<'a>>::InNeighbors
fn out_neighbors(&'a self, node_id: Self::NodeIndex) -> Self::OutNeighbors
[src]
fn in_neighbors(&'a self, node_id: Self::NodeIndex) -> Self::InNeighbors
[src]
impl<Topology: StaticGraph> StaticBigraph for NodeBigraphWrapper<Topology>
[src]
fn partner_node(&self, node_id: Self::NodeIndex) -> Option<Self::NodeIndex>
[src]
fn verify_node_pairing(&self) -> bool
[src]
fn verify_mirror_property(&self) -> bool
[src]
fn verify_unitig_length_is_zero(&self) -> bool
[src]
impl<Topology: StaticGraph> StaticBigraphFromDigraph for NodeBigraphWrapper<Topology> where
Self::NodeData: Eq + Hash + Debug,
[src]
Self::NodeData: Eq + Hash + Debug,
type Topology = Topology
The type of directed topology the bigraph is created from.
fn new(
topology: Self::Topology,
binode_mapping_function: fn(_: &Self::NodeData) -> Self::NodeData
) -> Self
[src]
topology: Self::Topology,
binode_mapping_function: fn(_: &Self::NodeData) -> Self::NodeData
) -> Self
fn new_unchecked(
_topology: Self::Topology,
_binode_mapping_function: fn(_: &Self::NodeData) -> Self::NodeData
) -> Self
[src]
_topology: Self::Topology,
_binode_mapping_function: fn(_: &Self::NodeData) -> Self::NodeData
) -> Self
Auto Trait Implementations
impl<Topology> RefUnwindSafe for NodeBigraphWrapper<Topology> where
Topology: RefUnwindSafe,
<Topology as GraphBase>::OptionalNodeIndex: RefUnwindSafe,
Topology: RefUnwindSafe,
<Topology as GraphBase>::OptionalNodeIndex: RefUnwindSafe,
impl<Topology> Send for NodeBigraphWrapper<Topology> where
Topology: Send,
<Topology as GraphBase>::OptionalNodeIndex: Send,
Topology: Send,
<Topology as GraphBase>::OptionalNodeIndex: Send,
impl<Topology> Sync for NodeBigraphWrapper<Topology> where
Topology: Sync,
<Topology as GraphBase>::OptionalNodeIndex: Sync,
Topology: Sync,
<Topology as GraphBase>::OptionalNodeIndex: Sync,
impl<Topology> Unpin for NodeBigraphWrapper<Topology> where
Topology: Unpin,
<Topology as GraphBase>::OptionalNodeIndex: Unpin,
Topology: Unpin,
<Topology as GraphBase>::OptionalNodeIndex: Unpin,
impl<Topology> UnwindSafe for NodeBigraphWrapper<Topology> where
Topology: UnwindSafe,
<Topology as GraphBase>::OptionalNodeIndex: UnwindSafe,
Topology: UnwindSafe,
<Topology as GraphBase>::OptionalNodeIndex: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DynamicGraph for T where
T: MutableGraphContainer + StaticGraph,
[src]
T: MutableGraphContainer + StaticGraph,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticGraph for T where
T: ImmutableGraphContainer + for<'a> NavigableGraph<'a>,
[src]
T: ImmutableGraphContainer + for<'a> NavigableGraph<'a>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,