pub struct IncrementalSubgraph<'a, Graph: GraphBase> { /* private fields */ }Expand description
A subgraph that stores the presence or absence of a node or edge using integers. Additionally, this subgraph has a current step that can be altered. Nodes and edges are added with that step, and only nodes and edges with a step lower or equal to the current one are counted as present. This allows to combine multiple subgraphs into one, if they are totally ordered by the subset relation.
Implementations§
source§impl<'a, Graph: ImmutableGraphContainer> IncrementalSubgraph<'a, Graph>
impl<'a, Graph: ImmutableGraphContainer> IncrementalSubgraph<'a, Graph>
sourcepub fn new_with_incremental_steps(
graph: &'a Graph,
incremental_steps: usize
) -> Self
pub fn new_with_incremental_steps( graph: &'a Graph, incremental_steps: usize ) -> Self
Create an incremental subgraph with the given amount of incremental steps.
sourcepub fn set_current_step(&mut self, current_step: usize)
pub fn set_current_step(&mut self, current_step: usize)
Set the current incremental step of the graph.
sourcepub fn new_nodes(&self) -> &Vec<Graph::NodeIndex>
pub fn new_nodes(&self) -> &Vec<Graph::NodeIndex>
Return the nodes that are added in the current incremental step.
sourcepub fn new_edges(&self) -> &Vec<Graph::EdgeIndex>
pub fn new_edges(&self) -> &Vec<Graph::EdgeIndex>
Return the edges that are added in the current incremental step.
sourcepub fn is_new_node(&self, node_index: <Self as GraphBase>::NodeIndex) -> bool
pub fn is_new_node(&self, node_index: <Self as GraphBase>::NodeIndex) -> bool
Returns true if this node was added in the current step.
sourcepub fn is_new_edge(&self, edge_index: <Self as GraphBase>::EdgeIndex) -> bool
pub fn is_new_edge(&self, edge_index: <Self as GraphBase>::EdgeIndex) -> bool
Returns true if this edge was added in the current step.
sourcepub fn is_newly_removed_node(
&self,
node_index: <Self as GraphBase>::NodeIndex
) -> bool
pub fn is_newly_removed_node( &self, node_index: <Self as GraphBase>::NodeIndex ) -> bool
Returns true if this node was removed in the current reverse step.
sourcepub fn is_newly_removed_edge(
&self,
edge_index: <Self as GraphBase>::EdgeIndex
) -> bool
pub fn is_newly_removed_edge( &self, edge_index: <Self as GraphBase>::EdgeIndex ) -> bool
Returns true if this edge was removed in the current reverse step.
Trait Implementations§
source§impl<Graph: GraphBase> GraphBase for IncrementalSubgraph<'_, Graph>
impl<Graph: GraphBase> GraphBase for IncrementalSubgraph<'_, Graph>
§type OptionalNodeIndex = <Graph as GraphBase>::OptionalNodeIndex
type OptionalNodeIndex = <Graph as GraphBase>::OptionalNodeIndex
§type OptionalEdgeIndex = <Graph as GraphBase>::OptionalEdgeIndex
type OptionalEdgeIndex = <Graph as GraphBase>::OptionalEdgeIndex
source§fn new_none_optional_node_index(&self) -> Self::OptionalNodeIndex
fn new_none_optional_node_index(&self) -> Self::OptionalNodeIndex
source§fn new_none_optional_edge_index(&self) -> Self::OptionalEdgeIndex
fn new_none_optional_edge_index(&self) -> Self::OptionalEdgeIndex
source§impl<Graph: ImmutableGraphContainer> ImmutableGraphContainer for IncrementalSubgraph<'_, Graph>
impl<Graph: ImmutableGraphContainer> ImmutableGraphContainer for IncrementalSubgraph<'_, Graph>
§type NodeIndices<'a>
where
Self: 'a = Filter<<Graph as ImmutableGraphContainer>::NodeIndices<'a>, Box<dyn Fn(&<Graph as GraphBase>::NodeIndex) -> bool + 'a, Global>>
type NodeIndices<'a> where Self: 'a = Filter<<Graph as ImmutableGraphContainer>::NodeIndices<'a>, Box<dyn Fn(&<Graph as GraphBase>::NodeIndex) -> bool + 'a, Global>>
§type EdgeIndices<'a>
where
Self: 'a = Filter<<Graph as ImmutableGraphContainer>::EdgeIndices<'a>, Box<dyn Fn(&<Graph as GraphBase>::EdgeIndex) -> bool + 'a, Global>>
type EdgeIndices<'a> where Self: 'a = Filter<<Graph as ImmutableGraphContainer>::EdgeIndices<'a>, Box<dyn Fn(&<Graph as GraphBase>::EdgeIndex) -> bool + 'a, Global>>
source§fn node_indices(&self) -> Self::NodeIndices<'_>
fn node_indices(&self) -> Self::NodeIndices<'_>
source§fn edge_indices(&self) -> Self::EdgeIndices<'_>
fn edge_indices(&self) -> Self::EdgeIndices<'_>
§type NodeIndicesCopied = IntoIter<<Graph as GraphBase>::NodeIndex, Global>
type NodeIndicesCopied = IntoIter<<Graph as GraphBase>::NodeIndex, Global>
§type EdgeIndicesCopied = IntoIter<<Graph as GraphBase>::EdgeIndex, Global>
type EdgeIndicesCopied = IntoIter<<Graph as GraphBase>::EdgeIndex, Global>
source§fn node_indices_copied(&self) -> Self::NodeIndicesCopied
fn node_indices_copied(&self) -> Self::NodeIndicesCopied
source§fn edge_indices_copied(&self) -> Self::EdgeIndicesCopied
fn edge_indices_copied(&self) -> Self::EdgeIndicesCopied
source§fn contains_node_index(&self, node_id: Self::NodeIndex) -> bool
fn contains_node_index(&self, node_id: Self::NodeIndex) -> bool
source§fn contains_edge_index(&self, edge_id: Self::EdgeIndex) -> bool
fn contains_edge_index(&self, edge_id: Self::EdgeIndex) -> bool
source§fn node_count(&self) -> usize
fn node_count(&self) -> usize
source§fn edge_count(&self) -> usize
fn edge_count(&self) -> usize
source§fn node_data(&self, node_id: Self::NodeIndex) -> &Self::NodeData
fn node_data(&self, node_id: Self::NodeIndex) -> &Self::NodeData
source§fn edge_data(&self, edge_id: Self::EdgeIndex) -> &Self::EdgeData
fn edge_data(&self, edge_id: Self::EdgeIndex) -> &Self::EdgeData
source§fn edge_endpoints(&self, edge_id: Self::EdgeIndex) -> Edge<Self::NodeIndex>
fn edge_endpoints(&self, edge_id: Self::EdgeIndex) -> Edge<Self::NodeIndex>
source§fn is_empty(&self) -> bool
fn is_empty(&self) -> bool
source§fn do_all_edges_endpoints_exist(&self) -> bool
fn do_all_edges_endpoints_exist(&self) -> bool
edge_endpoints are part of the graph for all edges.source§impl<Graph: ImmutableGraphContainer + SubgraphBase> MutableSubgraph for IncrementalSubgraph<'_, Graph>
impl<Graph: ImmutableGraphContainer + SubgraphBase> MutableSubgraph for IncrementalSubgraph<'_, Graph>
source§fn enable_node(
&mut self,
node_index: <<Self as SubgraphBase>::RootGraph as GraphBase>::NodeIndex
)
fn enable_node( &mut self, node_index: <<Self as SubgraphBase>::RootGraph as GraphBase>::NodeIndex )
source§fn enable_edge(
&mut self,
edge_index: <<Self as SubgraphBase>::RootGraph as GraphBase>::EdgeIndex
)
fn enable_edge( &mut self, edge_index: <<Self as SubgraphBase>::RootGraph as GraphBase>::EdgeIndex )
source§fn disable_node(
&mut self,
_node_index: <<Self as SubgraphBase>::RootGraph as GraphBase>::NodeIndex
)
fn disable_node( &mut self, _node_index: <<Self as SubgraphBase>::RootGraph as GraphBase>::NodeIndex )
source§fn disable_edge(
&mut self,
_edge_index: <<Self as SubgraphBase>::RootGraph as GraphBase>::EdgeIndex
)
fn disable_edge( &mut self, _edge_index: <<Self as SubgraphBase>::RootGraph as GraphBase>::EdgeIndex )
§type OutNeighbors<'a>
where
Self: 'a = FilterNeighborIterator<'a, <Graph as NavigableGraph>::OutNeighbors<'a>, IncrementalSubgraph<'_, Graph>>
type OutNeighbors<'a> where Self: 'a = FilterNeighborIterator<'a, <Graph as NavigableGraph>::OutNeighbors<'a>, IncrementalSubgraph<'_, Graph>>
§type InNeighbors<'a>
where
Self: 'a = FilterNeighborIterator<'a, <Graph as NavigableGraph>::InNeighbors<'a>, IncrementalSubgraph<'_, Graph>>
type InNeighbors<'a> where Self: 'a = FilterNeighborIterator<'a, <Graph as NavigableGraph>::InNeighbors<'a>, IncrementalSubgraph<'_, Graph>>
§type EdgesBetween<'a>
where
Self: 'a = FilterEdgeIndexIterator<'a, <Graph as NavigableGraph>::EdgesBetween<'a>, IncrementalSubgraph<'_, Graph>>
type EdgesBetween<'a> where Self: 'a = FilterEdgeIndexIterator<'a, <Graph as NavigableGraph>::EdgesBetween<'a>, IncrementalSubgraph<'_, Graph>>
source§fn out_neighbors(&self, node_id: Self::NodeIndex) -> Self::OutNeighbors<'_>
fn out_neighbors(&self, node_id: Self::NodeIndex) -> Self::OutNeighbors<'_>
source§fn in_neighbors(&self, node_id: Self::NodeIndex) -> Self::InNeighbors<'_>
fn in_neighbors(&self, node_id: Self::NodeIndex) -> Self::InNeighbors<'_>
source§fn edges_between(
&self,
from_node_id: Self::NodeIndex,
to_node_id: Self::NodeIndex
) -> Self::EdgesBetween<'_>
fn edges_between( &self, from_node_id: Self::NodeIndex, to_node_id: Self::NodeIndex ) -> Self::EdgesBetween<'_>
(from_node_id, to_node_id).source§fn contains_edge_between(
&self,
from: Self::NodeIndex,
to: Self::NodeIndex
) -> bool
fn contains_edge_between( &self, from: Self::NodeIndex, to: Self::NodeIndex ) -> bool
(from, to).source§fn edge_count_between(
&self,
from: Self::NodeIndex,
to: Self::NodeIndex
) -> usize
fn edge_count_between( &self, from: Self::NodeIndex, to: Self::NodeIndex ) -> usize
(from, to).source§fn out_degree(&self, node_id: Self::NodeIndex) -> usize
fn out_degree(&self, node_id: Self::NodeIndex) -> usize
source§fn in_degree(&self, node_id: Self::NodeIndex) -> usize
fn in_degree(&self, node_id: Self::NodeIndex) -> usize
source§fn is_biunivocal_node(&self, node_id: Self::NodeIndex) -> bool
fn is_biunivocal_node(&self, node_id: Self::NodeIndex) -> bool
source§fn is_bivalent_node(&self, node_id: Self::NodeIndex) -> bool
fn is_bivalent_node(&self, node_id: Self::NodeIndex) -> bool
source§fn is_split_edge(&self, edge_id: Self::EdgeIndex) -> bool
fn is_split_edge(&self, edge_id: Self::EdgeIndex) -> bool
source§fn is_join_edge(&self, edge_id: Self::EdgeIndex) -> bool
fn is_join_edge(&self, edge_id: Self::EdgeIndex) -> bool
source§fn is_split_node(&self, node_id: Self::NodeIndex) -> bool
fn is_split_node(&self, node_id: Self::NodeIndex) -> bool
source§fn is_join_node(&self, node_id: Self::NodeIndex) -> bool
fn is_join_node(&self, node_id: Self::NodeIndex) -> bool
source§impl<Graph: SubgraphBase> SubgraphBase for IncrementalSubgraph<'_, Graph>
impl<Graph: SubgraphBase> SubgraphBase for IncrementalSubgraph<'_, Graph>
Auto Trait Implementations§
impl<'a, Graph> RefUnwindSafe for IncrementalSubgraph<'a, Graph>where Graph: RefUnwindSafe, <Graph as GraphBase>::EdgeIndex: RefUnwindSafe, <Graph as GraphBase>::NodeIndex: RefUnwindSafe,
impl<'a, Graph> Send for IncrementalSubgraph<'a, Graph>where Graph: Sync, <Graph as GraphBase>::EdgeIndex: Send, <Graph as GraphBase>::NodeIndex: Send,
impl<'a, Graph> Sync for IncrementalSubgraph<'a, Graph>where Graph: Sync, <Graph as GraphBase>::EdgeIndex: Sync, <Graph as GraphBase>::NodeIndex: Sync,
impl<'a, Graph> Unpin for IncrementalSubgraph<'a, Graph>where <Graph as GraphBase>::EdgeIndex: Unpin, <Graph as GraphBase>::NodeIndex: Unpin,
impl<'a, Graph> UnwindSafe for IncrementalSubgraph<'a, Graph>where Graph: RefUnwindSafe, <Graph as GraphBase>::EdgeIndex: UnwindSafe, <Graph as GraphBase>::NodeIndex: UnwindSafe,
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
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where &'a Self: for<'a> IntoIterator,
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere Self: Borrow<B>, B: 'a + ?Sized, R: 'a,
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> Rwhere Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere Self: AsRef<U>, U: 'a + ?Sized, R: 'a,
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere Self: AsMut<U>, U: 'a + ?Sized, R: 'a,
self, then passes self.as_mut() into the pipe
function.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere Self: Deref<Target = T>, T: ?Sized,
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere Self: DerefMut<Target = T> + Deref, T: ?Sized,
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
.tap_ref_mut() only in debug builds, and is erased in release
builds.