pub trait L2: Num {
// Required method
fn l2(x: &[Self], y: &[Self]) -> f32;
// Provided method
fn l2_batch<'a>(
x: &'a [Self],
y: &'a [Self],
dimension: usize,
) -> Box<dyn Iterator<Item = f32> + 'a> { ... }
}
Expand description
Calculate the L2 distance between two vectors.
Required Methods§
Provided Methods§
fn l2_batch<'a>( x: &'a [Self], y: &'a [Self], dimension: usize, ) -> Box<dyn Iterator<Item = f32> + 'a>
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.