[−][src]Struct mkv_chain::MarkovChain2
MarkovChain with two nodes.
- Transition graph is a
Matrix2
- Initial state is a
Vec2
Methods
impl MarkovChain2
[src]
pub fn from(trans: Matrix2, init: Vec2) -> Self
[src]
Construct a Markov Chain from a transition matrix and an initial state
pub fn set_trans(&mut self, new_t: Matrix2)
[src]
Replace the transition matrix
pub fn set_init(&mut self, new_t: Vec2)
[src]
Replace the initial state
pub fn take_to(&self, state: usize) -> Vec2
[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 MarkovChain2
[src]
fn default() -> MarkovChain2
[src]
impl Clone for MarkovChain2
[src]
fn clone(&self) -> MarkovChain2
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl PartialOrd<MarkovChain2> for MarkovChain2
[src]
fn partial_cmp(&self, other: &MarkovChain2) -> Option<Ordering>
[src]
fn lt(&self, other: &MarkovChain2) -> bool
[src]
fn le(&self, other: &MarkovChain2) -> bool
[src]
fn gt(&self, other: &MarkovChain2) -> bool
[src]
fn ge(&self, other: &MarkovChain2) -> bool
[src]
impl PartialEq<MarkovChain2> for MarkovChain2
[src]
fn eq(&self, other: &MarkovChain2) -> bool
[src]
fn ne(&self, other: &MarkovChain2) -> bool
[src]
impl Copy for MarkovChain2
[src]
impl Debug for MarkovChain2
[src]
Auto Trait Implementations
impl Sync for MarkovChain2
impl Send for MarkovChain2
impl Unpin for MarkovChain2
impl UnwindSafe for MarkovChain2
impl RefUnwindSafe for MarkovChain2
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,