Kernel

Trait Kernel 

Source
pub trait Kernel<const D: usize>:
    Debug
    + Clone
    + PartialEq
    + Default {
    // Required method
    fn compute(&self, x1: &RowVector<D>, x2: &RowVector<D>) -> f32;
}
Expand description

Trait for kernel functions.

Required Methods§

Source

fn compute(&self, x1: &RowVector<D>, x2: &RowVector<D>) -> f32

Computes the kernel function between two vectors.

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.

Implementors§

Source§

impl<const D: usize> Kernel<D> for GaussianKernel

Source§

impl<const D: usize> Kernel<D> for LinearKernel

Source§

impl<const D: usize> Kernel<D> for PolynomialKernel