Struct net_ensembles::sw_graph::SwContainer [−][src]
pub struct SwContainer<T: Node> { /* fields omitted */ }
Expand description
Used for accessing neighbor information from graph
- contains Adjacency list and internal id (normally the index in the graph).
- also contains user specified data, i.e,
T
fromSwContainer<T>
- see trait
AdjContainer
Implementations
pub fn neighbors_sw(&self) -> SwEdgeIterNeighbors<'_>ⓘNotable traits for SwEdgeIterNeighbors<'a>impl<'a> Iterator for SwEdgeIterNeighbors<'a> type Item = &'a usize;
pub fn neighbors_sw(&self) -> SwEdgeIterNeighbors<'_>ⓘNotable traits for SwEdgeIterNeighbors<'a>impl<'a> Iterator for SwEdgeIterNeighbors<'a> type Item = &'a usize;
impl<'a> Iterator for SwEdgeIterNeighbors<'a> type Item = &'a usize;
returns iterator over indices of neighbors
- Iterator returns the same items as
self.neigbors()
, though it might be more efficient. It will never be less efficient
Count how many root edges are contained
Trait Implementations
return mut reference to what the AdjContainer contains
fn neighbors(&self) -> IterWrapper<'_>ⓘNotable traits for IterWrapper<'a>impl<'a> Iterator for IterWrapper<'a> type Item = &'a usize;
fn neighbors(&self) -> IterWrapper<'_>ⓘNotable traits for IterWrapper<'a>impl<'a> Iterator for IterWrapper<'a> type Item = &'a usize;
impl<'a> Iterator for IterWrapper<'a> type Item = &'a usize;
returns iterator over indices of neighbors
returns Some(first element from the adjecency List)
or None
check if vertex with other_id
is adjacent to self
Note:
(in GenericGraph<T>
: id
equals the index corresponding to self
)
Sorting adjecency lists
- worst case:
O(edges log(edges))
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<T, E> GraphIterators<T, GenericGraph<T, SwContainer<T>>, SwContainer<T>> for E where
T: Node,
E: WithGraph<T, GenericGraph<T, SwContainer<T>>>,
impl<T, E> GraphIterators<T, GenericGraph<T, SwContainer<T>>, SwContainer<T>> for E where
T: Node,
E: WithGraph<T, GenericGraph<T, SwContainer<T>>>,
fn contained_iter(&self) -> ContainedIter<'_, T, SwContainer<T>>ⓘNotable traits for ContainedIter<'a, T, A>impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
fn contained_iter(&self) -> ContainedIter<'_, T, SwContainer<T>>ⓘNotable traits for ContainedIter<'a, T, A>impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
Node
(for example EmptyNode
or whatever you used)self.container_iter().map(|container| container.contained())
fn contained_iter_neighbors(
&self,
index: usize
) -> NContainedIter<'_, T, SwContainer<T>>ⓘNotable traits for NContainedIter<'a, T, A>impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
fn contained_iter_neighbors(
&self,
index: usize
) -> NContainedIter<'_, T, SwContainer<T>>ⓘNotable traits for NContainedIter<'a, T, A>impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
index
&T
sort_adj
will affect the order
AdjContainer<Node>
, i.e., A
fn container_iter_neighbors(
&self,
index: usize
) -> NContainerIter<'_, T, SwContainer<T>>ⓘNotable traits for NContainerIter<'a, T, A>impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a A;
fn container_iter_neighbors(
&self,
index: usize
) -> NContainerIter<'_, T, SwContainer<T>>ⓘNotable traits for NContainerIter<'a, T, A>impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a A;
impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a A;
index
&T
sort_adj
will affect the orderfn contained_iter_neighbors_with_index(
&self,
index: usize
) -> NIContainedIter<'_, T, SwContainer<T>>ⓘNotable traits for NIContainedIter<'a, T, A>impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
fn contained_iter_neighbors_with_index(
&self,
index: usize
) -> NIContainedIter<'_, T, SwContainer<T>>ⓘNotable traits for NIContainedIter<'a, T, A>impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
index
index_neighbor
,&T
)sort_adj
will affect the orderreturns Iterator
Read more
fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, SwContainer<T>>ⓘNotable traits for DfsWithIndex<'a, T, A>impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, SwContainer<T>>ⓘNotable traits for DfsWithIndex<'a, T, A>impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
returns Iterator
Read more
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, SwContainer<T>>, SwContainer<T>> for SwEnsemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, SwContainer<T>>, SwContainer<T>> for SwEnsemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, SwContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, SwContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
index
&mut T
sort_adj
will affect the orderfn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, SwContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, SwContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
index
(index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the orderfn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, SwContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, SwContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
Node
(for example EmptyNode
or whatever you used)Auto Trait Implementations
impl<T> RefUnwindSafe for SwContainer<T> where
T: RefUnwindSafe,
impl<T> Send for SwContainer<T> where
T: Send,
impl<T> Sync for SwContainer<T> where
T: Sync,
impl<T> Unpin for SwContainer<T> where
T: Unpin,
impl<T> UnwindSafe for SwContainer<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn cast_trunc(self) -> T
pub fn cast_trunc(self) -> T
Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
pub fn cast_nearest(self) -> T
Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
pub fn cast_floor(self) -> T
Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
pub fn try_cast_ceil(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more