Metropolis

Struct Metropolis 

Source
pub struct Metropolis<S, R>
where S: State, R: Rng,
{ pub state: S, pub params: <S as State>::Params, pub beta: f64, pub steps: usize, pub accepted_moves: usize, pub rng: R, }

Fields§

§state: S§params: <S as State>::Params§beta: f64§steps: usize§accepted_moves: usize§rng: R

Implementations§

Source§

impl<S> Metropolis<S, ThreadRng>
where S: State + Default, <S as State>::Params: Default,

Source§

impl<S> Metropolis<S, ThreadRng>
where S: State, <S as State>::Params: Default,

Source

pub fn with_state(state: S, beta: f64, steps: usize) -> Metropolis<S, ThreadRng>

Source

pub fn with_state_no_beta(state: S, steps: usize) -> Metropolis<S, ThreadRng>

Source§

impl<S> Metropolis<S, ThreadRng>
where S: State,

Source

pub fn with_state_params( state: S, params: <S as State>::Params, beta: f64, steps: usize, ) -> Metropolis<S, ThreadRng>

Source

pub fn with_state_params_no_beta( state: S, params: <S as State>::Params, steps: usize, ) -> Metropolis<S, ThreadRng>

Source§

impl<S, R> Metropolis<S, R>
where S: State, <S as State>::Params: Default, R: Rng,

Source

pub fn with_state_rng( state: S, beta: f64, steps: usize, rng: R, ) -> Metropolis<S, R>

Source

pub fn with_state_rng_no_beta( state: S, steps: usize, rng: R, ) -> Metropolis<S, R>

Source§

impl<S, R> Metropolis<S, R>
where S: State + Default, <S as State>::Params: Default, R: Rng,

Source

pub fn with_rng(beta: f64, steps: usize, rng: R) -> Metropolis<S, R>

Source

pub fn with_rng_no_beta(steps: usize, rng: R) -> Metropolis<S, R>

Source§

impl<S, R> Metropolis<S, R>
where S: State, R: Rng,

Source

pub fn with_all( state: S, params: <S as State>::Params, beta: f64, steps: usize, rng: R, ) -> Metropolis<S, R>

Source

pub fn with_all_no_beta( state: S, params: <S as State>::Params, steps: usize, rng: R, ) -> Metropolis<S, R>

Source

pub fn step(&mut self)

Metropolis algorithm

Source

pub fn run_empty(&mut self)

Source

pub fn run_with<O>(&mut self) -> Vec<<O as Observer<S>>::Observation>
where O: Observer<S>,

Source

pub fn run_with_2<O1, O2>( &mut self, ) -> (Vec<<O1 as Observer<S>>::Observation>, Vec<<O2 as Observer<S>>::Observation>)
where O1: Observer<S>, O2: Observer<S>,

Source

pub fn run_with_3<O1, O2, O3>( &mut self, ) -> (Vec<<O1 as Observer<S>>::Observation>, Vec<<O2 as Observer<S>>::Observation>, Vec<<O3 as Observer<S>>::Observation>)
where O1: Observer<S>, O2: Observer<S>, O3: Observer<S>,

Source

pub fn run_with_4<O1, O2, O3, O4>( &mut self, ) -> (Vec<<O1 as Observer<S>>::Observation>, Vec<<O2 as Observer<S>>::Observation>, Vec<<O3 as Observer<S>>::Observation>, Vec<<O4 as Observer<S>>::Observation>)
where O1: Observer<S>, O2: Observer<S>, O3: Observer<S>, O4: Observer<S>,

Source

pub fn run_with_n<Obs>( &mut self, obs: Vec<Box<dyn DynObserver<S, Observation = Obs>>>, ) -> Vec<Vec<Obs>>

Makes a run for a vec of observers All observers needs to have the same Observation type And need to be dyn-capable All Observers are made dyn using DynObserver

Source

pub fn accepted_rate(&self) -> f64

Source

pub fn rejected_rate(&self) -> f64

Auto Trait Implementations§

§

impl<S, R> Freeze for Metropolis<S, R>
where S: Freeze, <S as State>::Params: Freeze, R: Freeze,

§

impl<S, R> RefUnwindSafe for Metropolis<S, R>

§

impl<S, R> Send for Metropolis<S, R>
where S: Send, <S as State>::Params: Send, R: Send,

§

impl<S, R> Sync for Metropolis<S, R>
where S: Sync, <S as State>::Params: Sync, R: Sync,

§

impl<S, R> Unpin for Metropolis<S, R>
where S: Unpin, <S as State>::Params: Unpin, R: Unpin,

§

impl<S, R> UnwindSafe for Metropolis<S, R>
where S: UnwindSafe, <S as State>::Params: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V