[−][src]Struct cfg::prediction::MinimalDistance
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]
G: ContextFree + 'a,
&'a G: ContextFreeRef<'a, Target = G>,
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]
I: Iterator<Item = (<&'a G as ContextFreeRef<'a>>::RuleRef, J)>,
J: Iterator<Item = usize>,
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,
G: Sync,
impl<'a, G> Sync for MinimalDistance<'a, G> where
G: Sync,
G: Sync,
impl<'a, G> Unpin for MinimalDistance<'a, G>
impl<'a, G> UnwindSafe for MinimalDistance<'a, G> where
G: RefUnwindSafe,
G: RefUnwindSafe,
impl<'a, G> RefUnwindSafe for MinimalDistance<'a, G> where
G: RefUnwindSafe,
G: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,