Skip to main content

MaxSimKernel

Trait MaxSimKernel 

Source
pub trait MaxSimKernel<T: Copy>:
    Send
    + Sync
    + Debug {
    // Required methods
    fn nrows(&self) -> usize;
    fn compute_max_sim(
        &self,
        doc: MatRef<'_, Standard<T>>,
        scores: &mut [f32],
    ) -> Result<(), MaxSimError>;
}
Expand description

Object-safe interface for computing per-query MaxSim scores.

Required Methods§

Source

fn nrows(&self) -> usize

Number of query rows whose scores this kernel produces.

Source

fn compute_max_sim( &self, doc: MatRef<'_, Standard<T>>, scores: &mut [f32], ) -> Result<(), MaxSimError>

Compute per-query MaxSim scores into scores. On zero docs, fills every slot with f32::MAX.

§Errors

MaxSimError::InvalidBufferLength if scores.len() != self.nrows().

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§