Skip to main content

lp_distance

Function lp_distance 

Source
pub fn lp_distance<T>(
    x: &[T],
    y: &[T],
    p: i32,
) -> Result<T, IncompatiblePointsError>
where T: Float + Sum + From<i32>,
Expand description

Computes the L^p distance between x and y.

Works for any p>0. An IncompatiblePointsError is returned when x and y have different lengths.