EdgeList

Struct EdgeList 

Source
pub struct EdgeList<E> {
    pub n_vertices: usize,
    /* private fields */
}
Expand description

A graph represented as a list of edges, whose vertices are in the range 0..n_vertices. No self-loops are allowed.

Fields§

§n_vertices: usize

Total number of vertices.

Implementations§

Source§

impl<E: Edge> EdgeList<E>

Source

pub fn new(n_vertices: usize) -> Self

New empty edge list.

Source

pub fn edges(&self) -> &[E]

Returns the underlying slice of edges.

Source

pub fn edges_mut(&mut self) -> &mut [E]

Returns a mutable slice of the underlying slice of edges.

Source

pub fn len(&self) -> usize

Returns the number of edges.

Source

pub fn is_empty(&self) -> bool

Returns whether there are edges.

Source

pub fn from_iterator<I: Iterator<Item = E>>(it: I) -> Self

Collects all the edges from the given iterator.

Source

pub fn number_of_vertices(&self) -> usize

Returns the number of vertices.

Source

pub fn add_edge(&mut self, e: E)

Adds an edge to the graph. Panics: if the edge to add is a self-loop.

Source

pub fn edge_iter(&self) -> impl Iterator<Item = &E> + '_

Returns an iterator over the edges.

Source

pub fn degrees(&self) -> Vec<usize>

Returns a count of the degree of each vertex.

Source

pub fn maximum_degree(&self) -> usize

Returns the maximum degree of a vertex in the edge list.

Source§

impl<VF: Value, const N: usize> EdgeList<FilteredEdge<OneCriticalGrade<VF, N>>>

Source

pub fn sort_lexicographically(&mut self)

Sort the filtered edges lexicographically in increasing order.

Source

pub fn sort_reverse_lexicographically(&mut self)

Reverse sort the filtered edges lexicographically.

Source

pub fn sort_colexicographically(&mut self)

Sort the filtered edges colexicographically in increasing order.

Source

pub fn sort_reverse_colexicographically(&mut self)

Reverse sort the filtered edges colexicographically.

Source

pub fn shuffle(&mut self)

Put a random order on the edges..

Trait Implementations§

Source§

impl<E: Clone> Clone for EdgeList<E>

Source§

fn clone(&self) -> EdgeList<E>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E: Debug> Debug for EdgeList<E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E: Edge> From<Vec<E>> for EdgeList<E>

Source§

fn from(edges: Vec<E>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<E> Freeze for EdgeList<E>

§

impl<E> RefUnwindSafe for EdgeList<E>
where E: RefUnwindSafe,

§

impl<E> Send for EdgeList<E>
where E: Send,

§

impl<E> Sync for EdgeList<E>
where E: Sync,

§

impl<E> Unpin for EdgeList<E>
where E: Unpin,

§

impl<E> UnwindSafe for EdgeList<E>
where E: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V