[−][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<NodeData: Debug, EdgeData: Debug, IndexType: Debug + PrimInt, Topology: Debug> Debug for NodeBigraphWrapper<NodeData, EdgeData, IndexType, Topology>
[src]
impl<NodeData, EdgeData, IndexType: PrimInt, T: Default> Default for NodeBigraphWrapper<NodeData, EdgeData, IndexType, T>
[src]
impl<NodeData: BidirectedNodeData, EdgeData: Clone, IndexType: PrimInt, T: DynamicGraph<NodeData, EdgeData, IndexType>> DynamicBigraph<NodeData, EdgeData, IndexType> for NodeBigraphWrapper<NodeData, EdgeData, IndexType, T>
[src]
fn add_partner_nodes(&mut self)
[src]
fn add_mirror_edges(&mut self)
[src]
impl<NodeData, EdgeData, IndexType: PrimInt, T: ImmutableGraphContainer<NodeData, EdgeData, IndexType>> ImmutableGraphContainer<NodeData, EdgeData, IndexType> for NodeBigraphWrapper<NodeData, EdgeData, IndexType, T>
[src]
fn node_indices(&self) -> NodeIndices<IndexType>ⓘImportant traits for NodeIndices<IndexType>
impl<IndexType> Iterator for NodeIndices<IndexType> where
IndexType: PrimInt, type Item = NodeIndex<IndexType>;
[src]
Important traits for NodeIndices<IndexType>
impl<IndexType> Iterator for NodeIndices<IndexType> where
IndexType: PrimInt, type Item = NodeIndex<IndexType>;
fn edge_indices(&self) -> EdgeIndices<IndexType>ⓘImportant traits for EdgeIndices<IndexType>
impl<IndexType> Iterator for EdgeIndices<IndexType> where
IndexType: PrimInt, type Item = EdgeIndex<IndexType>;
[src]
Important traits for EdgeIndices<IndexType>
impl<IndexType> Iterator for EdgeIndices<IndexType> where
IndexType: PrimInt, type Item = EdgeIndex<IndexType>;
fn node_count(&self) -> usize
[src]
fn edge_count(&self) -> usize
[src]
fn node_data(&self, node_id: NodeIndex<IndexType>) -> Option<&NodeData>
[src]
fn edge_data(&self, edge_id: EdgeIndex<IndexType>) -> Option<&EdgeData>
[src]
fn node_data_mut(
&mut self,
node_id: NodeIndex<IndexType>
) -> Option<&mut NodeData>
[src]
&mut self,
node_id: NodeIndex<IndexType>
) -> Option<&mut NodeData>
fn edge_data_mut(
&mut self,
edge_id: EdgeIndex<IndexType>
) -> Option<&mut EdgeData>
[src]
&mut self,
edge_id: EdgeIndex<IndexType>
) -> Option<&mut EdgeData>
fn contains_edge(
&self,
from: NodeIndex<IndexType>,
to: NodeIndex<IndexType>
) -> bool
[src]
&self,
from: NodeIndex<IndexType>,
to: NodeIndex<IndexType>
) -> bool
impl<NodeData, EdgeData, IndexType: PrimInt, T: MutableGraphContainer<NodeData, EdgeData, IndexType>> MutableGraphContainer<NodeData, EdgeData, IndexType> for NodeBigraphWrapper<NodeData, EdgeData, IndexType, T>
[src]
fn add_node(&mut self, node_data: NodeData) -> NodeIndex<IndexType>
[src]
fn add_edge(
&mut self,
from: NodeIndex<IndexType>,
to: NodeIndex<IndexType>,
edge_data: EdgeData
) -> EdgeIndex<IndexType>
[src]
&mut self,
from: NodeIndex<IndexType>,
to: NodeIndex<IndexType>,
edge_data: EdgeData
) -> EdgeIndex<IndexType>
fn remove_node(&mut self, node_id: NodeIndex<IndexType>) -> Option<NodeData>
[src]
fn remove_edge(&mut self, edge_id: EdgeIndex<IndexType>) -> Option<EdgeData>
[src]
impl<'a, NodeData, EdgeData, IndexType: PrimInt, T: NavigableGraph<'a, NodeData, EdgeData, IndexType>> NavigableGraph<'a, NodeData, EdgeData, IndexType> for NodeBigraphWrapper<NodeData, EdgeData, IndexType, T>
[src]
type OutNeighbors = <T as NavigableGraph<'a, NodeData, EdgeData, IndexType>>::OutNeighbors
type InNeighbors = <T as NavigableGraph<'a, NodeData, EdgeData, IndexType>>::InNeighbors
fn out_neighbors(
&'a self,
node_id: NodeIndex<IndexType>
) -> Option<Self::OutNeighbors>
[src]
&'a self,
node_id: NodeIndex<IndexType>
) -> Option<Self::OutNeighbors>
fn in_neighbors(
&'a self,
node_id: NodeIndex<IndexType>
) -> Option<Self::InNeighbors>
[src]
&'a self,
node_id: NodeIndex<IndexType>
) -> Option<Self::InNeighbors>
impl<NodeData, EdgeData, IndexType: PrimInt, T: StaticGraph<NodeData, EdgeData, IndexType>> StaticBigraph<NodeData, EdgeData, IndexType> for NodeBigraphWrapper<NodeData, EdgeData, IndexType, T>
[src]
fn partner_node(
&self,
node_id: NodeIndex<IndexType>
) -> Option<NodeIndex<IndexType>>
[src]
&self,
node_id: NodeIndex<IndexType>
) -> Option<NodeIndex<IndexType>>
fn verify_node_pairing(&self) -> bool
[src]
fn verify_mirror_property(&self) -> bool
[src]
fn verify_unitig_length_is_zero(&self) -> bool
[src]
impl<NodeData: Eq + Hash + Debug, EdgeData, IndexType: PrimInt + Debug, Topology: StaticGraph<NodeData, EdgeData, IndexType>> StaticBigraphFromDigraph<NodeData, EdgeData, IndexType> for NodeBigraphWrapper<NodeData, EdgeData, IndexType, Topology>
[src]
Auto Trait Implementations
impl<NodeData, EdgeData, IndexType, Topology> RefUnwindSafe for NodeBigraphWrapper<NodeData, EdgeData, IndexType, Topology> where
EdgeData: RefUnwindSafe,
IndexType: RefUnwindSafe,
NodeData: RefUnwindSafe,
Topology: RefUnwindSafe,
EdgeData: RefUnwindSafe,
IndexType: RefUnwindSafe,
NodeData: RefUnwindSafe,
Topology: RefUnwindSafe,
impl<NodeData, EdgeData, IndexType, Topology> Send for NodeBigraphWrapper<NodeData, EdgeData, IndexType, Topology> where
EdgeData: Send,
IndexType: Send,
NodeData: Send,
Topology: Send,
EdgeData: Send,
IndexType: Send,
NodeData: Send,
Topology: Send,
impl<NodeData, EdgeData, IndexType, Topology> Sync for NodeBigraphWrapper<NodeData, EdgeData, IndexType, Topology> where
EdgeData: Sync,
IndexType: Sync,
NodeData: Sync,
Topology: Sync,
EdgeData: Sync,
IndexType: Sync,
NodeData: Sync,
Topology: Sync,
impl<NodeData, EdgeData, IndexType, Topology> Unpin for NodeBigraphWrapper<NodeData, EdgeData, IndexType, Topology> where
EdgeData: Unpin,
IndexType: Unpin,
NodeData: Unpin,
Topology: Unpin,
EdgeData: Unpin,
IndexType: Unpin,
NodeData: Unpin,
Topology: Unpin,
impl<NodeData, EdgeData, IndexType, Topology> UnwindSafe for NodeBigraphWrapper<NodeData, EdgeData, IndexType, Topology> where
EdgeData: UnwindSafe,
IndexType: UnwindSafe,
NodeData: UnwindSafe,
Topology: UnwindSafe,
EdgeData: UnwindSafe,
IndexType: UnwindSafe,
NodeData: UnwindSafe,
Topology: 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<NodeData, EdgeData, IndexType, T> DynamicGraph<NodeData, EdgeData, IndexType> for T where
IndexType: PrimInt,
T: ImmutableGraphContainer<NodeData, EdgeData, IndexType> + MutableGraphContainer<NodeData, EdgeData, IndexType> + for<'a> NavigableGraph<'a, NodeData, EdgeData, IndexType>,
[src]
IndexType: PrimInt,
T: ImmutableGraphContainer<NodeData, EdgeData, IndexType> + MutableGraphContainer<NodeData, EdgeData, IndexType> + for<'a> NavigableGraph<'a, NodeData, EdgeData, IndexType>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<NodeData, EdgeData, IndexType, T> StaticGraph<NodeData, EdgeData, IndexType> for T where
IndexType: PrimInt,
T: ImmutableGraphContainer<NodeData, EdgeData, IndexType> + for<'a> NavigableGraph<'a, NodeData, EdgeData, IndexType>,
[src]
IndexType: PrimInt,
T: ImmutableGraphContainer<NodeData, EdgeData, IndexType> + for<'a> NavigableGraph<'a, NodeData, EdgeData, IndexType>,
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>,