Struct net_ensembles::graph::NodeContainer
source · [−]pub struct NodeContainer<T> { /* private fields */ }
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
fromNodeContainer<T>
- see trait
AdjContainer
Trait Implementations
sourceimpl<T> AdjContainer<T> for NodeContainer<T>
impl<T> AdjContainer<T> for NodeContainer<T>
sourcefn contained_mut(&mut self) -> &mut T
fn contained_mut(&mut self) -> &mut T
return mut reference to what the NodeContainer contains
sourcefn 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;
returns iterator over indices of neighbors
sourcefn is_adjacent(&self, other_id: usize) -> bool
fn is_adjacent(&self, other_id: usize) -> bool
check if vertex with other_id
is adjacent to self
Note:
(in Graph<T>
: id
equals the index corresponding to self
)
sourcefn sort_adj(&mut self)
fn sort_adj(&mut self)
Sorting adjecency lists
- calls
sort_unstable()
on all adjecency lists
sourcefn shuffle_adj<R: Rng>(&mut self, rng: &mut R)
fn shuffle_adj<R: Rng>(&mut self, rng: &mut R)
shuffle adjacency list
sourcefn get_adj_first(&self) -> Option<&usize>
fn get_adj_first(&self) -> Option<&usize>
returns
Some(first element from the adjecency List)
or None
sourceimpl<T> AdjList<usize> for NodeContainer<T>
impl<T> AdjList<usize> for NodeContainer<T>
sourcefn edges(&self) -> &[usize]
fn edges(&self) -> &[usize]
Intended for all AdjContainer, which store all their
edges in a continouse slice/vector. This will return
a reference to the edge slice, which you can use
to iterate or do other stuff Read more
sourceimpl<T: Clone> Clone for NodeContainer<T>
impl<T: Clone> Clone for NodeContainer<T>
sourcefn clone(&self) -> NodeContainer<T>
fn clone(&self) -> NodeContainer<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<T: Debug> Debug for NodeContainer<T>
impl<T: Debug> Debug for NodeContainer<T>
sourceimpl<'de, T> Deserialize<'de> for NodeContainer<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for NodeContainer<T>where
T: Deserialize<'de>,
sourcefn 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
sourceimpl<T, E> GraphIterators<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for Ewhere
T: Node,
E: WithGraph<T, GenericGraph<T, NodeContainer<T>>>,
impl<T, E> GraphIterators<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for Ewhere
T: Node,
E: WithGraph<T, GenericGraph<T, NodeContainer<T>>>,
sourcefn contained_iter(&self) -> ContainedIter<'_, T, NodeContainer<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, NodeContainer<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;
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())
sourcefn contained_iter_neighbors(
&self,
index: usize
) -> NContainedIter<'_, T, NodeContainer<T>, IterWrapper<'_>>ⓘNotable traits for NContainedIter<'a, T, A, I>impl<'a, T, A, I> Iterator for NContainedIter<'a, T, A, I>where
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a T;
fn contained_iter_neighbors(
&self,
index: usize
) -> NContainedIter<'_, T, NodeContainer<T>, IterWrapper<'_>>ⓘNotable traits for NContainedIter<'a, T, A, I>impl<'a, T, A, I> Iterator for NContainedIter<'a, T, A, I>where
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a T;
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a T;
index
&T
sort_adj
will affect the ordersourcefn container_iter(&self) -> Iter<'_, NodeContainer<T>>
fn container_iter(&self) -> Iter<'_, NodeContainer<T>>
AdjContainer<Node>
, i.e., A
sourcefn container_iter_neighbors(
&self,
index: usize
) -> NContainerIter<'_, T, NodeContainer<T>, IterWrapper<'_>>ⓘNotable traits for NContainerIter<'a, T, A, I>impl<'a, T, A, I> Iterator for NContainerIter<'a, T, A, I>where
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a A;
fn container_iter_neighbors(
&self,
index: usize
) -> NContainerIter<'_, T, NodeContainer<T>, IterWrapper<'_>>ⓘNotable traits for NContainerIter<'a, T, A, I>impl<'a, T, A, I> Iterator for NContainerIter<'a, T, A, I>where
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a A;
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a A;
index
&T
sort_adj
will affect the ordersourcefn contained_iter_neighbors_with_index(
&self,
index: usize
) -> NIContainedIter<'_, T, NodeContainer<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, NodeContainer<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);
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
index
index_neighbor
,&T
)sort_adj
will affect the ordersourcefn dfs(&self, index: usize) -> Dfs<'_, T, NodeContainer<T>>ⓘNotable traits for Dfs<'a, T, A>impl<'a, T, A> Iterator for Dfs<'a, T, A>where
T: 'a,
A: AdjContainer<T>, type Item = &'a T;
fn dfs(&self, index: usize) -> Dfs<'_, T, NodeContainer<T>>ⓘNotable traits for Dfs<'a, T, A>impl<'a, T, A> Iterator for Dfs<'a, T, A>where
T: 'a,
A: AdjContainer<T>, type Item = &'a T;
T: 'a,
A: AdjContainer<T>, type Item = &'a T;
returns
Iterator
Read moresourcefn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, NodeContainer<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, NodeContainer<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);
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
returns
Iterator
Read moresourcefn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, NodeContainer<T>>ⓘNotable traits for Bfs<'a, T, A>impl<'a, T, A> Iterator for Bfs<'a, T, A>where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T, usize);
fn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, NodeContainer<T>>ⓘNotable traits for Bfs<'a, T, A>impl<'a, T, A> Iterator for Bfs<'a, T, A>where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T, usize);
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T, usize);
returns
Iterator
Read moresourceimpl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for BAensemble<T, R>where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for BAensemble<T, R>where
T: Node + SerdeStateConform,
R: Rng,
sourcefn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>, IterWrapper<'_>>ⓘNotable traits for NContainedIterMut<'a, T, A, I>impl<'a, T, A, I> Iterator for NContainedIterMut<'a, T, A, I>where
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a mut T;
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>, IterWrapper<'_>>ⓘNotable traits for NContainedIterMut<'a, T, A, I>impl<'a, T, A, I> Iterator for NContainedIterMut<'a, T, A, I>where
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a mut T;
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a mut T;
index
&mut T
sort_adj
will affect the ordersourcefn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, NodeContainer<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, NodeContainer<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);
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
index
(index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the ordersourcefn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<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, NodeContainer<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;
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
Node
(for example EmptyNode
or whatever you used)sourceimpl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ConfigurationModel<T, R>where
T: Node,
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ConfigurationModel<T, R>where
T: Node,
sourcefn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>, IterWrapper<'_>>ⓘNotable traits for NContainedIterMut<'a, T, A, I>impl<'a, T, A, I> Iterator for NContainedIterMut<'a, T, A, I>where
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a mut T;
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>, IterWrapper<'_>>ⓘNotable traits for NContainedIterMut<'a, T, A, I>impl<'a, T, A, I> Iterator for NContainedIterMut<'a, T, A, I>where
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a mut T;
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a mut T;
index
&mut T
sort_adj
will affect the ordersourcefn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, NodeContainer<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, NodeContainer<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);
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
index
(index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the ordersourcefn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<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, NodeContainer<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;
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
Node
(for example EmptyNode
or whatever you used)sourceimpl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ErEnsembleC<T, R>where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ErEnsembleC<T, R>where
T: Node + SerdeStateConform,
R: Rng,
sourcefn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>, IterWrapper<'_>>ⓘNotable traits for NContainedIterMut<'a, T, A, I>impl<'a, T, A, I> Iterator for NContainedIterMut<'a, T, A, I>where
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a mut T;
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>, IterWrapper<'_>>ⓘNotable traits for NContainedIterMut<'a, T, A, I>impl<'a, T, A, I> Iterator for NContainedIterMut<'a, T, A, I>where
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a mut T;
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a mut T;
index
&mut T
sort_adj
will affect the ordersourcefn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, NodeContainer<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, NodeContainer<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);
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
index
(index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the ordersourcefn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<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, NodeContainer<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;
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
Node
(for example EmptyNode
or whatever you used)sourceimpl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ErEnsembleM<T, R>where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ErEnsembleM<T, R>where
T: Node + SerdeStateConform,
R: Rng,
sourcefn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>, IterWrapper<'_>>ⓘNotable traits for NContainedIterMut<'a, T, A, I>impl<'a, T, A, I> Iterator for NContainedIterMut<'a, T, A, I>where
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a mut T;
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>, IterWrapper<'_>>ⓘNotable traits for NContainedIterMut<'a, T, A, I>impl<'a, T, A, I> Iterator for NContainedIterMut<'a, T, A, I>where
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a mut T;
T: 'a,
A: AdjContainer<T>,
I: Iterator<Item = &'a usize> + 'a, type Item = &'a mut T;
index
&mut T
sort_adj
will affect the ordersourcefn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, NodeContainer<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, NodeContainer<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);
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
index
(index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the ordersourcefn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<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, NodeContainer<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;
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 NodeContainer<T>where
T: RefUnwindSafe,
impl<T> Send for NodeContainer<T>where
T: Send,
impl<T> Sync for NodeContainer<T>where
T: Sync,
impl<T> Unpin for NodeContainer<T>where
T: Unpin,
impl<T> UnwindSafe for NodeContainer<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Cast to integer, truncating Read more
fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
fn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer Read more
fn try_cast_trunc(self) -> Result<T, Error>
fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
fn try_cast_nearest(self) -> Result<T, Error>
fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
fn try_cast_floor(self) -> Result<T, Error>
fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
fn try_cast_ceil(self) -> Result<T, Error>
fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more