[−][src]Struct net_ensembles::sw_graph::SwContainer
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
Methods
impl<T: Node> SwContainer<T>
[src]
pub fn count_root(&self) -> usize
[src]
Count how many root edges are contained
Trait Implementations
impl<T: Node> AdjContainer<T> for SwContainer<T>
[src]
fn new(id: u32, node: T) -> Self
[src]
Create new instance with id
fn parse_str(to_parse: &str) -> Option<(&str, Self)> where
Self: Sized,
[src]
Self: Sized,
parse from str
- tries to parse a AdjContainer from a
str
. - returns
None
if failed
Returns Option((a, b))
a) string slice beginning directly after the part, that was used to parse
b) the AdjContainer
resulting form the parsing
fn contained<'a>(&'a self) -> &'a T
[src]
return reference to what the AdjContainer contains
fn contained_mut(&mut self) -> &mut T
[src]
return mut reference to what the AdjContainer contains
fn neighbors(&self) -> IterWrapper
[src]
returns iterator over indices of neighbors
fn degree(&self) -> usize
[src]
count number of neighbors, i.e. number of edges incident to self
fn id(&self) -> u32
[src]
returns id of container
fn get_adj_first(&self) -> Option<&u32>
[src]
returns Some(first element from the adjecency List)
or None
fn is_adjacent(&self, other_id: &u32) -> bool
[src]
check if vertex with other_id
is adjacent to self
Note:
(in GenericGraph<T>
: id
equals the index corresponding to self
)
fn sort_adj(&mut self)
[src]
Sorting adjecency lists
- worst case:
O(edges log(edges))
impl<T: Clone + Node> Clone for SwContainer<T>
[src]
fn clone(&self) -> SwContainer<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug + Node> Debug for SwContainer<T>
[src]
impl<T: Node> Display for SwContainer<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for SwContainer<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for SwContainer<T> where
T: Send,
T: Send,
impl<T> Sync for SwContainer<T> where
T: Sync,
T: Sync,
impl<T> Unpin for SwContainer<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for SwContainer<T> where
T: UnwindSafe,
T: 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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,