AbstractKernel

Trait AbstractKernel 

Source
pub trait AbstractKernel: Send + Sync {
    // Required method
    fn compute<T: CustomNumeric + Copy + Debug>(&self, x: T, y: T) -> T;

    // Provided method
    fn is_centrosymmetric(&self) -> bool { ... }
}
Expand description

Trait for general kernels (both centrosymmetric and non-centrosymmetric)

This trait provides the basic interface for computing kernel values. Centrosymmetric kernels should implement CentrosymmKernel instead, which provides additional optimizations.

Required Methods§

Source

fn compute<T: CustomNumeric + Copy + Debug>(&self, x: T, y: T) -> T

Compute the kernel value K(x, y) with high precision

§Arguments
  • x - The x coordinate (typically in [-xmax, xmax])
  • y - The y coordinate (typically in [-ymax, ymax])
§Returns

The kernel value K(x, y)

Provided Methods§

Source

fn is_centrosymmetric(&self) -> bool

Check if the kernel is centrosymmetric

Returns true if and only if K(x, y) == K(-x, -y) for all values of x and y. This allows the kernel to be block-diagonalized, speeding up the singular value expansion by a factor of 4.

§Returns

True if the kernel is centrosymmetric, false otherwise.

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§