Params

Trait Params 

Source
pub trait Params:
    Send
    + Sync
    + Clone {
    // Required methods
    fn dimension(&self) -> usize;
    fn values(&self) -> impl Iterator<Item = &f64>;
    fn collect(iter: impl Iterator<Item = f64>) -> Self;
}
Expand description

Model parameters defining the state space of the Markov chain

Required Methods§

Source

fn dimension(&self) -> usize

Dimension of the state space

This can depend on self in situations where the number of parameters depends on the data itself, e.g. the number of groups in a hierarchical model.

Source

fn values(&self) -> impl Iterator<Item = &f64>

Access the individual parameter values as an iterator

Source

fn collect(iter: impl Iterator<Item = f64>) -> Self

Collect new parameters from the given iterator

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Params for Box<[f64]>

Model parameters stored as a boxed slice of length n considered as an element of the vector space R^n

Source§

fn dimension(&self) -> usize

Source§

fn values(&self) -> impl Iterator<Item = &f64>

Source§

fn collect(iter: impl Iterator<Item = f64>) -> Self

Source§

impl Params for Vec<f64>

Model parameters stored as a vector of length n considered as an element of the vector space R^n

Source§

fn dimension(&self) -> usize

Source§

fn values(&self) -> impl Iterator<Item = &f64>

Source§

fn collect(iter: impl Iterator<Item = f64>) -> Self

Source§

impl<const N: usize> Params for [f64; N]

Model parameters stored as an array of length N considered as an element of the vector space R^N

Source§

fn dimension(&self) -> usize

Source§

fn values(&self) -> impl Iterator<Item = &f64>

Source§

fn collect(iter: impl Iterator<Item = f64>) -> Self

Implementors§