diff -r 05089fbc0310 -r d8305c9b6fdf src/nalgebra_support.rs --- a/src/nalgebra_support.rs Tue Dec 31 08:30:43 2024 -0500 +++ b/src/nalgebra_support.rs Sat Dec 21 23:32:20 2024 -0500 @@ -89,6 +89,7 @@ where SM: StorageMut + Clone, SV1: Storage + Clone, M : Dim, E : Scalar + Zero + One + Float, DefaultAllocator : Allocator { + type Owned = OVector; #[inline] fn axpy>>(&mut self, α : E, x : I, β : E) { @@ -99,6 +100,16 @@ fn copy_from>>(&mut self, y : I) { y.eval(|ỹ| Matrix::copy_from(self, ỹ)) } + + #[inline] + fn set_zero(&mut self) { + self.iter_mut().for_each(|e| *e = E::ZERO); + } + + #[inline] + fn similar_origin(&self) -> Self::Owned { + OVector::zeros_generic(M::from_usize(self.len()), Const) + } } /* Implemented automatically as Euclidean. @@ -191,11 +202,6 @@ type Output = OVector; #[inline] - fn similar_origin(&self) -> OVector { - OVector::zeros_generic(M::from_usize(self.len()), Const) - } - - #[inline] fn norm2_squared(&self) -> E { Vector::::norm_squared(self) }