Struct ClosureGraph

Source
pub struct ClosureGraph<V, Fv, Fa> { /* private fields */ }

Implementations§

Source§

impl<V, Fv, Fa> ClosureGraph<V, Fv, Fa>

Source

pub fn new(vs: Fv, adj: Fa) -> Self

Trait Implementations§

Source§

impl<V, Fv, Fa, Ia, T> Adjacencies for ClosureGraph<V, Fv, Fa>
where V: Eq + Copy, Ia: Iterator<Item = (V, T)>, Fa: Fn(V) -> Ia, T: Clone,

Source§

type AIndex = VIndexWithValue<V, T>

Source§

type AIter<'g> = Map<Ia, fn((V, T)) -> VIndexWithValue<V, T>> where V: 'g, Fv: 'g, Fa: 'g

Source§

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

Source§

impl<V, Fv, Fa, Ia, T> AdjacenciesWithValue<T> for ClosureGraph<V, Fv, Fa>
where V: Eq + Copy, Ia: Iterator<Item = (V, T)>, Fa: Fn(V) -> Ia, T: Clone,

Source§

type AIndex = VIndexWithValue<V, T>

Source§

type AIter<'g> = Map<Ia, fn((V, T)) -> VIndexWithValue<V, T>> where V: 'g, Fv: 'g, Fa: 'g

Source§

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

Source§

impl<'a, V, Fv, Fa, M, Ia, T, U> AdjacencyView<'a, M, U> for ClosureGraph<V, Fv, Fa>
where V: Eq + Copy, Ia: Iterator<Item = (V, T)>, Fa: Fn(V) -> Ia, T: Clone, M: 'a + Fn(T) -> U,

Source§

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

Source§

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

Source§

impl<V, Fv, Fa> GraphBase for ClosureGraph<V, Fv, Fa>
where V: Eq + Copy,

Source§

impl<V, Fv, Fa, T> VertexMap<T> for ClosureGraph<V, Fv, Fa>
where V: Eq + Copy + Hash, T: Clone,

Source§

type Vmap = (HashMap<V, T>, T)

Source§

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

Source§

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

Source§

fn vmap_get_mut<'a>( &self, (map, val): &'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<V, Fv, Fa, T> VertexView<(HashMap<V, T>, T), T> for ClosureGraph<V, Fv, Fa>
where V: Eq + Copy + Hash, T: Clone,

Source§

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

Source§

impl<V, Fv, Fa, Iv> Vertices for ClosureGraph<V, Fv, Fa>
where V: Eq + Copy, Iv: Iterator<Item = V>, Fv: Fn() -> Iv,

Source§

type VIter<'g> = Iv where V: 'g, Fv: 'g, Fa: 'g

Source§

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

Auto Trait Implementations§

§

impl<V, Fv, Fa> Freeze for ClosureGraph<V, Fv, Fa>
where Fv: Freeze, Fa: Freeze,

§

impl<V, Fv, Fa> RefUnwindSafe for ClosureGraph<V, Fv, Fa>

§

impl<V, Fv, Fa> Send for ClosureGraph<V, Fv, Fa>
where Fv: Send, Fa: Send,

§

impl<V, Fv, Fa> Sync for ClosureGraph<V, Fv, Fa>
where Fv: Sync, Fa: Sync,

§

impl<V, Fv, Fa> Unpin for ClosureGraph<V, Fv, Fa>
where Fv: Unpin, Fa: Unpin,

§

impl<V, Fv, Fa> UnwindSafe for ClosureGraph<V, Fv, Fa>
where Fv: UnwindSafe, 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