diff -r f7b87d84864d -r 4f6ca107ccb1 src/nalgebra_support.rs --- a/src/nalgebra_support.rs Sun Dec 22 14:54:46 2024 -0500 +++ b/src/nalgebra_support.rs Sun Dec 22 15:30:34 2024 -0500 @@ -198,8 +198,8 @@ } #[inline] - fn dist2_squared(&self, other : &Self) -> E { - metric_distance_squared(self, other) + fn dist2_squared>(&self, other : I) -> E { + metric_distance_squared(self, other.ref_instance()) } } @@ -263,12 +263,12 @@ impl Dist for Vector where M : Dim, - S : Storage, + S : Storage + Clone, E : Float + Scalar + Zero + One + RealField, DefaultAllocator : Allocator { #[inline] - fn dist(&self, other : &Self, _ : L1) -> E { - LpNorm(1).metric_distance(self, other) + fn dist>(&self, other : I, _ : L1) -> E { + LpNorm(1).metric_distance(self, other.ref_instance()) } } @@ -288,12 +288,12 @@ impl Dist for Vector where M : Dim, - S : Storage, + S : Storage + Clone, E : Float + Scalar + Zero + One + RealField, DefaultAllocator : Allocator { #[inline] - fn dist(&self, other : &Self, _ : L2) -> E { - LpNorm(2).metric_distance(self, other) + fn dist>(&self, other : I, _ : L2) -> E { + LpNorm(2).metric_distance(self, other.ref_instance()) } } @@ -313,12 +313,12 @@ impl Dist for Vector where M : Dim, - S : Storage, + S : Storage + Clone, E : Float + Scalar + Zero + One + RealField, DefaultAllocator : Allocator { #[inline] - fn dist(&self, other : &Self, _ : Linfinity) -> E { - UniformNorm.metric_distance(self, other) + fn dist>(&self, other : I, _ : Linfinity) -> E { + UniformNorm.metric_distance(self, other.ref_instance()) } }