[][src]Trait markovian::StateIterator

pub trait StateIterator: Iterator + State + Sized {
    fn state_as_item(&self) -> Option<Self::Item>;

    fn trajectory(self) -> Chain<IntoIter<Self::Item>, Self> { ... }
}

Iterator with an internal state that is thought as the "zero" element.

Required methods

fn state_as_item(&self) -> Option<Self::Item>

If Iterator and State uses the same type, then a direct implementation is the following.

self.state().cloned()

Remarks

  1. Cloned is needed if the underlying iterator depends on its internal state.
  2. You should use #[inline] when implementing this method.
Loading content...

Provided methods

fn trajectory(self) -> Chain<IntoIter<Self::Item>, Self>

Returns a new iterator whose first element is the state (seen as an item of the Iteratior) and then follows with the iterator.

Loading content...

Implementors

impl<N, T, F, R> StateIterator for TimedMarkovChain<N, T, F, R> where
    T: Debug + Clone,
    F: Transition<T, (N, T)>,
    R: Rng,
    N: From<f64>, 
[src]

impl<T, D, R> StateIterator for BranchingProcess<T, D, R> where
    T: Debug + PartialEq + Clone + One + Zero + PartialOrd + Unsigned,
    D: Distribution<T>,
    R: Rng
[src]

impl<T, F, R> StateIterator for MarkovChain<T, F, R> where
    T: Debug + Clone,
    F: Transition<T, T>,
    R: Rng
[src]

impl<T, W, R> StateIterator for ContFiniteMarkovChain<T, W, R> where
    W: Float + Weight,
    Exp1: Distribution<W>,
    Uniform<W>: Debug + Clone,
    T: Debug + PartialEq + Clone,
    R: Rng
[src]

impl<T, W, R> StateIterator for FiniteMarkovChain<T, W, R> where
    W: Weight,
    Uniform<W>: Debug + Clone,
    T: Debug + PartialEq + Clone,
    R: Rng
[src]

Loading content...