pub trait StreamingEm<const D: usize, R>: EmStep{
// Required method
fn stream_e_step(
&mut self,
sfs: Sfs<D>,
reader: &mut R,
) -> Result<(Self::Status, USfs<D>)>;
// Provided methods
fn stream_em_step(
&mut self,
sfs: Sfs<D>,
reader: &mut R,
) -> Result<(Self::Status, Sfs<D>)> { ... }
fn stream_em<S>(
&mut self,
sfs: Sfs<D>,
reader: &mut R,
stopping_rule: S,
) -> Result<(Self::Status, Sfs<D>)>
where S: Stop<Self, Status = Self::Status> { ... }
}
Expand description
A type capable of running an EM-like algorithm for SFS inference by streaming through data.
Required Methods§
Provided Methods§
Sourcefn stream_em_step(
&mut self,
sfs: Sfs<D>,
reader: &mut R,
) -> Result<(Self::Status, Sfs<D>)>
fn stream_em_step( &mut self, sfs: Sfs<D>, reader: &mut R, ) -> Result<(Self::Status, Sfs<D>)>
A full EM-step of the algorithm.
Like the Em::e_step
, this should correspond to a full pass through the reader
.
§Panics
Panics if the shapes of the SFS and the input do not match.
Sourcefn stream_em<S>(
&mut self,
sfs: Sfs<D>,
reader: &mut R,
stopping_rule: S,
) -> Result<(Self::Status, Sfs<D>)>
fn stream_em<S>( &mut self, sfs: Sfs<D>, reader: &mut R, stopping_rule: S, ) -> Result<(Self::Status, Sfs<D>)>
Runs the EM algorithm until convergence.
This consists of running EM-steps until convergence, which is decided by the provided
stopping_rule
. The converged SFS, and the status of the last EM-step, are returned.
§Panics
Panics if the shapes of the SFS and the input do not match.
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.