Skip to main content

Norm

Trait Norm 

Source
pub trait Norm<T, To = f32> {
    // Required method
    fn evaluate(&self, x: T) -> To;
}
Expand description

Evaluate a norm of the argument x and return the result as the requested type.

Note that while this has a similar signature to PreprocessedDistanceFunction, the semantics of this trait are different. Implementations are expected to be light-weight types that implement some kind of reduction on on x.

Required Methods§

Source

fn evaluate(&self, x: T) -> To

Implementors§

Source§

impl Norm<&[f32]> for LInfNorm

Source§

impl Norm<&[f16]> for LInfNorm

Source§

impl<T> Norm<T> for FastL2Norm
where Self: Target1<Current, f32, T>,

Source§

impl<T> Norm<T> for L1Norm
where Self: Target1<Current, f32, T>,

Source§

impl<T, To> Norm<T, To> for FastL2NormSquared
where Self: Target1<Current, To, T>, T: Copy, To: Copy,