diff -r 221728aeeb7e -r fa8df5a14486 src/nalgebra_support.rs --- a/src/nalgebra_support.rs Wed Sep 03 19:55:05 2025 -0500 +++ b/src/nalgebra_support.rs Wed Sep 03 20:19:41 2025 -0500 @@ -159,15 +159,7 @@ } #[inline] - fn eval_decompose<'b, R>(self, f: impl FnOnce(OMatrix) -> R) -> R - where - Self: 'b, - { - f(self.into_owned()) - } - - #[inline] - fn eval_ref_decompose<'b, R>( + fn eval_ref<'b, R>( &'b self, f: impl FnOnce(>>::Reference<'b>) -> R, ) -> R @@ -190,6 +182,14 @@ { self.cow_owned() } + + #[inline] + fn decompose<'b>(self) -> OMatrix + where + Self: 'b, + { + self.into_owned() + } } impl<'a, S1, S2, M, K, E> Instance, MatrixDecomposition> @@ -215,14 +215,7 @@ g(self.as_view()) } - fn eval_decompose<'b, R>(self, f: impl FnOnce(OMatrix) -> R) -> R - where - Self: 'b, - { - f(self.into_owned()) - } - - fn eval_ref_decompose<'b, R>( + fn eval_ref<'b, R>( &'b self, f: impl FnOnce(>>::Reference<'b>) -> R, ) -> R @@ -245,6 +238,14 @@ { self.cow_owned() } + + #[inline] + fn decompose<'b>(self) -> OMatrix + where + Self: 'b, + { + self.into_owned() + } } impl Mapping> for Matrix @@ -344,7 +345,7 @@ #[inline] fn copy_from>>(&mut self, y: I) { - y.eval(|ỹ| Matrix::copy_from(self, ỹ)) + y.eval_ref(|ỹ| Matrix::copy_from(self, &ỹ)) } #[inline] @@ -458,7 +459,7 @@ #[inline] fn dot>(&self, other: I) -> E { - other.eval_ref_decompose(|ref r| Vector::::dot(self, r)) + other.eval_ref(|ref r| Vector::::dot(self, r)) } #[inline] @@ -468,7 +469,7 @@ #[inline] fn dist2_squared>(&self, other: I) -> E { - other.eval_ref_decompose(|ref r| metric_distance_squared(self, r)) + other.eval_ref(|ref r| metric_distance_squared(self, r)) } } @@ -547,7 +548,7 @@ { #[inline] fn dist>(&self, other: I, _: L1) -> E { - other.eval_ref_decompose(|ref r| nalgebra::Norm::metric_distance(&LpNorm(1), self, r)) + other.eval_ref(|ref r| nalgebra::Norm::metric_distance(&LpNorm(1), self, r)) } } @@ -575,7 +576,7 @@ { #[inline] fn dist>(&self, other: I, _: L2) -> E { - other.eval_ref_decompose(|ref r| nalgebra::Norm::metric_distance(&LpNorm(2), self, r)) + other.eval_ref(|ref r| nalgebra::Norm::metric_distance(&LpNorm(2), self, r)) } } @@ -603,7 +604,7 @@ { #[inline] fn dist>(&self, other: I, _: Linfinity) -> E { - other.eval_ref_decompose(|ref r| nalgebra::Norm::metric_distance(&UniformNorm, self, r)) + other.eval_ref(|ref r| nalgebra::Norm::metric_distance(&UniformNorm, self, r)) } }