[][src]Struct markovian::distributions::Raw

pub struct Raw<I> { /* fields omitted */ }

Distribution over possibly infinte iterators.

Examples

With help of the raw_dist macro, we construct a random variable that samples always a fixed value.

let value = 0;
let dis = raw_dist![(1.0, value)];

assert_eq!(value, dis.sample(&mut thread_rng()));

Correctedness

Bounds on probabilities are checked only in debug mode using debug_assert. This way, there are guarantees when developing code that probabilities have valid values, but during a release run there is no overhead!

Costs

Sample cost: O(iterator length). Construction cost: O(1).

Remarks

This struct is meant to be used when one needs to sample once from an infinte iterator.

Implementations

impl<I> Raw<I>[src]

pub fn new(iter: I) -> Self[src]

Trait Implementations

impl<I: Clone> Clone for Raw<I>[src]

impl<I: Debug> Debug for Raw<I>[src]

impl<P, T, I> Distribution<T> for Raw<I> where
    P: Zero + One + PartialOrd + Debug + Copy,
    f64: From<P>,
    I: IntoIterator<Item = (P, T)> + Clone
[src]

impl<I: PartialEq> PartialEq<Raw<I>> for Raw<I>[src]

impl<I> StructuralPartialEq for Raw<I>[src]

Auto Trait Implementations

impl<I> RefUnwindSafe for Raw<I> where
    I: RefUnwindSafe

impl<I> Send for Raw<I> where
    I: Send

impl<I> Sync for Raw<I> where
    I: Sync

impl<I> Unpin for Raw<I> where
    I: Unpin

impl<I> UnwindSafe for Raw<I> where
    I: UnwindSafe

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,