Skip to main content

CMLossComputer

Trait CMLossComputer 

Source
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§

Source

fn compute_loss( &self, state: &WorkingClustering, cms: &Array3<CountType>, ) -> f64

Source

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§

Source

fn initialize(&mut self, state: &WorkingClustering, cms: &Array3<CountType>)

Source

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".

Implementors§