[][src]Struct cfg::prediction::MinimalDistance

pub struct MinimalDistance<'a, G: 'a> { /* fields omitted */ }

Calculation of minimum distance from one part of the grammar to another. Similar to multi-source shortest path search in a graph.

Methods

impl<'a, G> MinimalDistance<'a, G> where
    G: ContextFree + 'a,
    &'a G: ContextFreeRef<'a, Target = G>, 
[src]

pub fn new(grammar: &'a G) -> Self[src]

Returns a new MinimalDistance for a grammar.

pub fn distances(&self) -> &[Vec<Option<u32>>][src]

Returns distances in order respective to the order of rule iteration.

pub fn minimal_distances<I, J>(&mut self, iter: I) -> &[Vec<Option<u32>>] where
    I: Iterator<Item = (<&'a G as ContextFreeRef<'a>>::RuleRef, J)>,
    J: Iterator<Item = usize>, 
[src]

Calculates minimal distance from one parts of the grammar to others. Returns distances in order respective to the order of rule iteration.

Auto Trait Implementations

impl<'a, G> Send for MinimalDistance<'a, G> where
    G: Sync

impl<'a, G> Sync for MinimalDistance<'a, G> where
    G: Sync

impl<'a, G> Unpin for MinimalDistance<'a, G>

impl<'a, G> UnwindSafe for MinimalDistance<'a, G> where
    G: RefUnwindSafe

impl<'a, G> RefUnwindSafe for MinimalDistance<'a, G> where
    G: RefUnwindSafe

Blanket Implementations

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

impl<T> From<T> for T[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<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]