Struct UsizeGraph

Source
pub struct UsizeGraph<Fa> { /* private fields */ }

Implementations§

Source§

impl<Fa> UsizeGraph<Fa>

Source

pub fn new(vsize: usize, adj: Fa) -> Self

Trait Implementations§

Source§

impl<Fa, I, T> Adjacencies for UsizeGraph<Fa>
where I: Iterator<Item = (usize, T)>, Fa: Fn(usize) -> I, T: Clone,

Source§

type AIndex = VIndexWithValue<usize, T>

Source§

type AIter<'g> = Map<I, fn((usize, T)) -> VIndexWithValue<usize, T>> where Fa: 'g

Source§

fn adjacencies(&self, vid: Self::VIndex) -> Self::AIter<'_>

Source§

impl<Fa, I, T> AdjacenciesWithValue<T> for UsizeGraph<Fa>
where I: Iterator<Item = (usize, T)>, Fa: Fn(usize) -> I, T: Clone,

Source§

type AIndex = VIndexWithValue<usize, T>

Source§

type AIter<'g> = Map<I, fn((usize, T)) -> VIndexWithValue<usize, T>> where Fa: 'g

Source§

fn adjacencies_with_value(&self, vid: Self::VIndex) -> Self::AIter<'_>

Source§

impl<'a, Fa, M, I, T, U> AdjacencyView<'a, M, U> for UsizeGraph<Fa>
where I: Iterator<Item = (usize, T)>, Fa: Fn(usize) -> I, T: Clone, M: 'a + Fn(T) -> U,

Source§

type AViewIter<'g> = AdjacencyViewIterFromValue<'g, 'a, UsizeGraph<Fa>, M, T, U> where Fa: 'g

Source§

fn aviews<'g>(&'g self, map: &'a M, vid: Self::VIndex) -> Self::AViewIter<'g>

Source§

impl<Fa> GraphBase for UsizeGraph<Fa>

Source§

impl<Fa, T> VertexMap<T> for UsizeGraph<Fa>

Source§

type Vmap = Vec<T>

Source§

fn construct_vmap<F>(&self, f: F) -> Self::Vmap
where F: FnMut() -> T,

Source§

fn vmap_get<'a>(&self, map: &'a Self::Vmap, vid: Self::VIndex) -> &'a T

Source§

fn vmap_get_mut<'a>( &self, map: &'a mut Self::Vmap, vid: Self::VIndex, ) -> &'a mut T

Source§

fn vmap_set(&self, map: &mut Self::Vmap, vid: Self::VIndex, x: T)

Source§

impl<Fa, T> VertexView<[T], T> for UsizeGraph<Fa>
where T: Clone,

Source§

fn vview(&self, map: &[T], vid: Self::VIndex) -> T

Source§

impl<Fa, T> VertexView<Vec<T>, T> for UsizeGraph<Fa>
where T: Clone,

Source§

fn vview(&self, map: &Vec<T>, vid: Self::VIndex) -> T

Source§

impl<Fa> Vertices for UsizeGraph<Fa>

Source§

type VIter<'g> = Range<usize> where Fa: 'g

Source§

fn vertices(&self) -> Self::VIter<'_>

Auto Trait Implementations§

§

impl<Fa> Freeze for UsizeGraph<Fa>
where Fa: Freeze,

§

impl<Fa> RefUnwindSafe for UsizeGraph<Fa>
where Fa: RefUnwindSafe,

§

impl<Fa> Send for UsizeGraph<Fa>
where Fa: Send,

§

impl<Fa> Sync for UsizeGraph<Fa>
where Fa: Sync,

§

impl<Fa> Unpin for UsizeGraph<Fa>
where Fa: Unpin,

§

impl<Fa> UnwindSafe for UsizeGraph<Fa>
where Fa: 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> 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<G> ShortestPathExt for G
where G: GraphBase,

Source§

fn bfs_distance_ss<'a, S, M>( &self, source: Self::VIndex, weight: &'a M, ) -> <Self as VertexMap<S::T>>::Vmap
where Self: VertexMap<S::T> + AdjacencyView<'a, M, S::T>, S: ShortestPathSemiRing,

Source§

fn bfs_distance_ms<'a, S, M, I>( &self, sources: I, weight: &'a M, ) -> <Self as VertexMap<S::T>>::Vmap
where Self: VertexMap<S::T> + AdjacencyView<'a, M, S::T>, S: ShortestPathSemiRing, I: IntoIterator<Item = Self::VIndex>,

Source§

fn dijkstra_ss<'a, S, M>( &self, source: Self::VIndex, weight: &'a M, ) -> <Self as VertexMap<S::T>>::Vmap
where Self: VertexMap<S::T> + AdjacencyView<'a, M, S::T>, S: ShortestPathSemiRing,

Source§

fn dijkstra_ms<'a, S, M, I>( &self, sources: I, weight: &'a M, ) -> <Self as VertexMap<S::T>>::Vmap
where Self: VertexMap<S::T> + AdjacencyView<'a, M, S::T>, S: ShortestPathSemiRing, I: IntoIterator<Item = Self::VIndex>,

Source§

fn bellman_ford_ss<'a, S, M>( &self, source: Self::VIndex, weight: &'a M, check: bool, ) -> Option<<Self as VertexMap<S::T>>::Vmap>
where Self: Vertices + VertexMap<S::T> + AdjacencyView<'a, M, S::T> + VertexSize, S: ShortestPathSemiRing,

Source§

fn bellman_ford_ms<'a, S, M, I>( &self, sources: I, weight: &'a M, check: bool, ) -> Option<<Self as VertexMap<S::T>>::Vmap>
where Self: Vertices + VertexMap<S::T> + AdjacencyView<'a, M, S::T> + VertexSize, S: ShortestPathSemiRing, I: IntoIterator<Item = Self::VIndex>,

Source§

fn warshall_floyd_ap<'a, S, M>( &self, weight: &'a M, ) -> <Self as VertexMap<<Self as VertexMap<S::T>>::Vmap>>::Vmap
where Self: Vertices + VertexMap<S::T> + VertexMap<<Self as VertexMap<S::T>>::Vmap> + AdjacencyView<'a, M, S::T>, <Self as VertexMap<S::T>>::Vmap: Clone, S: ShortestPathSemiRing,

Source§

impl<G> SteinerTreeExt for G
where G: Vertices,

Source§

fn steiner_tree<'a, S, M, I>( &self, terminals: I, weight: &'a M, ) -> SteinerTreeOutput<'_, S, Self>
where Self: VertexMap<S::T> + AdjacencyView<'a, M, S::T>, S: ShortestPathSemiRing, I: IntoIterator<Item = Self::VIndex> + ExactSizeIterator,

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<G, F, T> VertexView<F, T> for G
where G: GraphBase, F: Fn(<G as GraphBase>::VIndex) -> T,

Source§

fn vview(&self, map: &F, vid: <G as GraphBase>::VIndex) -> T