Skip to main content

ClosureGraph

Struct ClosureGraph 

Source
pub struct ClosureGraph<V, Fv, Fa> {
    vs: Fv,
    adj: Fa,
    _marker: PhantomData<fn() -> V>,
}

Fields§

§vs: Fv§adj: Fa§_marker: PhantomData<fn() -> V>

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> DirectedGraph for ClosureGraph<V, Fv, Fa>
where Self: Graph,

Source§

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

Source§

type Vertex = V

Source§

type Label = T

Source§

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

Source§

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

Source§

fn vsize(&self) -> usize

Source§

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

Source§

fn neighbors(&self, vertex: Self::Vertex) -> Self::Neighbors<'_>

Source§

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

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::Vertex) -> &'a T

Source§

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

Source§

fn vmap_set(&self, map: &mut Self::Vmap, vertex: Self::Vertex, value: T)

Auto Trait Implementations§

§

impl<V, Fv, Fa> Freeze for ClosureGraph<V, Fv, Fa>
where Fv: Freeze, Fa: Freeze, PhantomData<fn() -> V>: 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, PhantomData<fn() -> V>: Send,

§

impl<V, Fv, Fa> Sync for ClosureGraph<V, Fv, Fa>
where Fv: Sync, Fa: Sync, PhantomData<fn() -> V>: Sync,

§

impl<V, Fv, Fa> Unpin for ClosureGraph<V, Fv, Fa>
where Fv: Unpin, Fa: Unpin, PhantomData<fn() -> V>: Unpin,

§

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

§

impl<V, Fv, Fa> UnwindSafe for ClosureGraph<V, Fv, Fa>
where Fv: UnwindSafe, Fa: UnwindSafe, PhantomData<fn() -> V>: 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<G> GraphOrderExt for G
where G: Graph + ?Sized,

Source§

fn bfs_order(&self, root: Self::Vertex) -> Vec<Self::Vertex>
where Self: VertexMap<bool>,

Source§

fn dfs_order(&self, root: Self::Vertex) -> Vec<Self::Vertex>
where Self: VertexMap<bool>,

Source§

fn dfs_tree(&self, root: Self::Vertex) -> <Self as EdgeMap<bool>>::Emap
where Self: EdgeMap<bool> + VertexMap<bool>,

Source§

fn for_each_connected_components<F>(&self, f: F)
where Self: VertexMap<bool>, F: FnMut(&Self, Self::Vertex, &[(Self::Vertex, Option<Self::Vertex>)]),

f: |g, root, ord: [vertex, parent]| {}
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: Graph + ?Sized,

Source§

fn standard_sp<'a, M>(&'a self) -> ShortestPathBuilder<'a, Self, StandardSp<M>>
where Self: Sized, M: Monoid<T: Bounded + Ord>,

Source§

fn standard_sp_additive<'a, T>( &'a self, ) -> ShortestPathBuilder<'a, Self, StandardSp<AdditiveOperation<T>>>
where Self: Sized, T: Clone + Zero + Add<Output = T> + Bounded + Ord,

Source§

fn option_sp<'a, M>(&'a self) -> ShortestPathBuilder<'a, Self, OptionSp<M>>
where Self: Sized, M: Monoid<T: Ord>,

Source§

fn option_sp_additive<'a, T>( &'a self, ) -> ShortestPathBuilder<'a, Self, OptionSp<AdditiveOperation<T>>>
where Self: Sized, T: Clone + Zero + Add<Output = T> + Ord,

Source§

fn path_folding_sp<'a, M, S>( &'a self, ) -> ShortestPathBuilder<'a, Self, PathFoldingSp<M, S>>
where Self: Sized, M: Monoid<T: Bounded + Ord>, S: SemiRing,

Source§

fn path_folding_sp_additive_addmul<'a, T, U>( &'a self, ) -> ShortestPathBuilder<'a, Self, PathFoldingSp<AdditiveOperation<T>, AddMulOperation<U>>>
where Self: Sized, T: Clone + Zero + Add<Output = T> + Bounded + Ord, U: DotProduct + One,

Source§

impl<G> SteinerTreeExt for G
where G: Graph + ?Sized,

Source§

fn steiner_tree(&self) -> SteinerTreeBuilder<'_, Self>
where Self: Sized,

Source§

impl<T> ToArrayVecScalar for T

Source§

impl<G> TopologicalSortExt for G
where G: DirectedGraph + ?Sized,

Source§

fn topological_sort(&self) -> Vec<Self::Vertex>
where Self: VertexMap<usize>,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.