pub trait Model:
Send
+ Sync
+ 'static {
type Math<'model>: Math
where Self: 'model;
// Required methods
fn math<R: Rng + ?Sized>(&self, rng: &mut R) -> Result<Self::Math<'_>>;
fn init_position<R: Rng + ?Sized>(
&self,
rng: &mut R,
position: &mut [f64],
) -> Result<()>;
}
Expand description
Trait for MCMC models with associated math backend and initialization.
Defines the interface for models that can be used with MCMC sampling algorithms. Provides access to mathematical operations needed for sampling and methods for initializing the sampling position.
The trait is thread-safe to enable parallel sampling scenarios.
Required Associated Types§
Sourcetype Math<'model>: Math
where
Self: 'model
type Math<'model>: Math where Self: 'model
The math backend used by this MCMC model.
Specifies which math implementation will be used for computing log probability densities, gradients, and other operations required during sampling.
The lifetime parameter allows the math backend to borrow from the model instance.
Required Methods§
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.