[][src]Struct mkv_chain::MarkovChain3

pub struct MarkovChain3 { /* fields omitted */ }

MarkovChain with three nodes.

  • Transition graph is a Matrix3
  • Initial state is a Vec3

Methods

impl MarkovChain3[src]

pub fn from(trans: Matrix3, init: Vec3) -> Self[src]

Construct a Markov Chain from a transition matrix and an initial state

pub fn set_trans(&mut self, new_t: Matrix3)[src]

Replace the transition matrix

pub fn set_init(&mut self, new_t: Vec3)[src]

Replace the initial state

pub fn take_to(&self, state: usize) -> Vec3[src]

Run the chain until to a step.

pub fn has_absorbing(&self) -> bool[src]

Check if the chain has an absorbing state. An absorbing state will loop on itself catching every bit coming to it. A state is considered absorbing if it has a probability of 1 to itself, there is a least one path leading to it.

Example:

    let t_mat = Matrix2::new(
        [[1.0, 0.0],
         [0.1, 0.9]]
    );
    let initial = Vec2::new([0.0, 1.0]);
    // Initial state will converge to Vec2::new([1.0, 0.0])
    assert!(
        MarkovChain2::from(t_mat, initial).has_absorbing(),
    );

Trait Implementations

impl Default for MarkovChain3[src]

impl Clone for MarkovChain3[src]

impl PartialOrd<MarkovChain3> for MarkovChain3[src]

impl PartialEq<MarkovChain3> for MarkovChain3[src]

impl Copy for MarkovChain3[src]

impl Debug for MarkovChain3[src]

Auto Trait Implementations

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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