[][src]Struct net_ensembles::sw_graph::SwContainer

pub struct SwContainer<T: Node> { /* fields omitted */ }

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 from SwContainer<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]

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]

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

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,