pub trait CMLossComputer {
// Required methods
fn compute_loss(
&self,
state: &WorkingClustering,
cms: &Array3<CountType>,
) -> f64;
fn change_in_loss(
&self,
item_index: usize,
to_label: LabelType,
from_label_option: Option<LabelType>,
state: &WorkingClustering,
cms: &Array3<CountType>,
draws: &Clusterings,
) -> f64;
// Provided methods
fn initialize(&mut self, state: &WorkingClustering, cms: &Array3<CountType>) { ... }
fn decision_callback(
&mut self,
item_index: usize,
to_label_option: Option<LabelType>,
from_label_option: Option<LabelType>,
state: &WorkingClustering,
cms: &Array3<CountType>,
draws: &Clusterings,
) { ... }
}Required Methods§
fn compute_loss( &self, state: &WorkingClustering, cms: &Array3<CountType>, ) -> f64
fn change_in_loss( &self, item_index: usize, to_label: LabelType, from_label_option: Option<LabelType>, state: &WorkingClustering, cms: &Array3<CountType>, draws: &Clusterings, ) -> f64
Provided Methods§
fn initialize(&mut self, state: &WorkingClustering, cms: &Array3<CountType>)
fn decision_callback( &mut self, item_index: usize, to_label_option: Option<LabelType>, from_label_option: Option<LabelType>, state: &WorkingClustering, cms: &Array3<CountType>, draws: &Clusterings, )
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".