[][src]Struct flag_algebra::flags::CGraph

pub struct CGraph<E> {
    pub size: usize,
    // some fields omitted
}

Edge-colored graphs.

Implentation of graphs whose edges are colored by a number in a set {1,…,k-1} (So that accounting for non-edges, each pair has k possible states).

The number k is determined at compile-time by a type-level number from the typenum crate. Specifically, CGraph<Uk> represents k-edge-colored graphs if Uk is the typenum type reprenting k.

Fields

size: usize

Implementations

impl<E> CGraph<E>[src]

pub fn is_edge(&self, u: usize, v: usize) -> bool[src]

Returns true id uv is an edge.

pub fn edge(&self, u: usize, v: usize) -> u8[src]

Return the color of an edge uv. Returns 0 if there is no edge.

pub fn nbrs(&self, v: usize) -> Vec<usize>[src]

Return the vector of vertices adjacent to v.

pub fn new(n: usize, edge: &[((usize, usize), u8)]) -> Self where
    E: Unsigned
[src]

Create a new colored graph with the specified edges. Edges not listed get value 0.

pub fn empty(n: usize) -> Self[src]

Create the graph on n vertices with no edge.

Trait Implementations

impl<E> Canonize for CGraph<E> where
    E: Unsigned + Clone + Eq + Ord + Debug
[src]

impl<E: Clone> Clone for CGraph<E>[src]

impl<E: Debug> Debug for CGraph<E>[src]

impl<'de, E> Deserialize<'de> for CGraph<E>[src]

impl<E> Display for CGraph<E>[src]

impl<E> Draw for CGraph<E>[src]

impl<E: Eq> Eq for CGraph<E>[src]

impl<E> Flag for CGraph<E> where
    E: Unsigned + Clone + Eq + Ord + Debug
[src]

impl<E: Ord> Ord for CGraph<E>[src]

impl<E: PartialEq> PartialEq<CGraph<E>> for CGraph<E>[src]

impl<E: PartialOrd> PartialOrd<CGraph<E>> for CGraph<E>[src]

impl<E> Serialize for CGraph<E>[src]

impl<E> StructuralEq for CGraph<E>[src]

impl<E> StructuralPartialEq for CGraph<E>[src]

Auto Trait Implementations

impl<E> RefUnwindSafe for CGraph<E> where
    E: RefUnwindSafe

impl<E> Send for CGraph<E> where
    E: Send

impl<E> Sync for CGraph<E> where
    E: Sync

impl<E> Unpin for CGraph<E> where
    E: Unpin

impl<E> UnwindSafe for CGraph<E> where
    E: 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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

impl<F> Html for F where
    F: Draw
[src]

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

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

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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>,