diff -r 7b2ee3e84c5f -r 5e3c1874797d src/nalgebra_support.rs --- a/src/nalgebra_support.rs Fri Dec 06 16:14:41 2024 -0500 +++ b/src/nalgebra_support.rs Wed Dec 11 20:45:17 2024 -0500 @@ -10,7 +10,7 @@ use nalgebra::{ Matrix, Storage, StorageMut, OMatrix, Dim, DefaultAllocator, Scalar, - ClosedMul, ClosedAdd, SimdComplexField, Vector, OVector, RealField, + ClosedAddAssign, ClosedMulAssign, SimdComplexField, Vector, OVector, RealField, LpNorm, UniformNorm }; use nalgebra::Norm as NalgebraNorm; @@ -28,11 +28,11 @@ impl Apply> for Matrix where SM: Storage, SV: Storage, - N : Dim, M : Dim, K : Dim, E : Scalar + ClosedMul + ClosedAdd + Zero + One, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator { + N : Dim, M : Dim, K : Dim, E : Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator { type Output = OMatrix; #[inline] @@ -43,11 +43,11 @@ impl<'a, SM,SV,N,M,K,E> Apply<&'a Matrix> for Matrix where SM: Storage, SV: Storage, - N : Dim, M : Dim, K : Dim, E : Scalar + ClosedMul + ClosedAdd + Zero + One, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator { + N : Dim, M : Dim, K : Dim, E : Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator { type Output = OMatrix; #[inline] @@ -58,21 +58,21 @@ impl<'a, SM,SV,N,M,K,E> Linear> for Matrix where SM: Storage, SV: Storage, - N : Dim, M : Dim, K : Dim, E : Scalar + ClosedMul + ClosedAdd + Zero + One, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator { + N : Dim, M : Dim, K : Dim, E : Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator { type Codomain = OMatrix; } impl GEMV, Matrix> for Matrix where SM: Storage, SV1: Storage, SV2: StorageMut, - N : Dim, M : Dim, K : Dim, E : Scalar + ClosedMul + ClosedAdd + Zero + One + Float, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator { + N : Dim, M : Dim, K : Dim, E : Scalar + Zero + One + Float, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator { #[inline] fn gemv(&self, y : &mut Matrix, α : E, x : &Matrix, β : E) { @@ -87,8 +87,8 @@ impl AXPY> for Vector where SM: StorageMut, SV1: Storage, - M : Dim, E : Scalar + ClosedMul + ClosedAdd + Zero + One + Float, - DefaultAllocator : Allocator { + M : Dim, E : Scalar + Zero + One + Float, + DefaultAllocator : Allocator { #[inline] fn axpy(&mut self, α : E, x : &Vector, β : E) { @@ -103,8 +103,8 @@ impl Projection for Vector where SM: StorageMut, - M : Dim, E : Scalar + ClosedMul + ClosedAdd + Zero + One + Float + RealField, - DefaultAllocator : Allocator { + M : Dim, E : Scalar + Zero + One + Float + RealField, + DefaultAllocator : Allocator { #[inline] fn proj_ball_mut(&mut self, ρ : E, _ : Linfinity) { self.iter_mut().for_each(|v| *v = num_traits::clamp(*v, -ρ, ρ)) @@ -114,11 +114,11 @@ impl<'own,SV1,SV2,SM,N,M,K,E> Adjointable,Matrix> for Matrix where SM: Storage, SV1: Storage, SV2: Storage, - N : Dim, M : Dim, K : Dim, E : Scalar + ClosedMul + ClosedAdd + Zero + One + SimdComplexField, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator, - DefaultAllocator : Allocator { + N : Dim, M : Dim, K : Dim, E : Scalar + Zero + One + SimdComplexField, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator, + DefaultAllocator : Allocator { type AdjointCodomain = OMatrix; type Adjoint<'a> = OMatrix where SM : 'a; @@ -131,10 +131,10 @@ impl Dot,E> for Vector where M : Dim, - E : Float + Scalar + ClosedMul + ClosedAdd + Zero + One, + E : Float + Scalar + Zero + One, S : Storage, Si : Storage, - DefaultAllocator : Allocator { + DefaultAllocator : Allocator { #[inline] fn dot(&self, other : &Vector) -> E { @@ -171,8 +171,8 @@ for Vector where M : Dim, S : StorageMut, - E : Float + Scalar + ClosedMul + ClosedAdd + Zero + One + RealField, - DefaultAllocator : Allocator { + E : Float + Scalar + Zero + One + RealField, + DefaultAllocator : Allocator { type Output = OVector; @@ -196,8 +196,8 @@ for Vector where M : DimName, S : StorageMut, - E : Float + Scalar + ClosedMul + ClosedAdd + Zero + One + RealField, - DefaultAllocator : Allocator { + E : Float + Scalar + Zero + One + RealField, + DefaultAllocator : Allocator { #[inline] fn origin() -> OVector { @@ -209,8 +209,8 @@ for Vector where M : Dim, S : StorageMut, - E : Float + Scalar + ClosedMul + ClosedAdd + Zero + One + RealField, - DefaultAllocator : Allocator { + E : Float + Scalar + Zero + One + RealField, + DefaultAllocator : Allocator { #[inline] fn norm(&self, _ : L1) -> E { @@ -222,8 +222,8 @@ for Vector where M : Dim, S : StorageMut, - E : Float + Scalar + ClosedMul + ClosedAdd + Zero + One + RealField, - DefaultAllocator : Allocator { + E : Float + Scalar + Zero + One + RealField, + DefaultAllocator : Allocator { #[inline] fn dist(&self, other : &Self, _ : L1) -> E { LpNorm(1).metric_distance(self, other) @@ -234,8 +234,8 @@ for Vector where M : Dim, S : StorageMut, - E : Float + Scalar + ClosedMul + ClosedAdd + Zero + One + RealField, - DefaultAllocator : Allocator { + E : Float + Scalar + Zero + One + RealField, + DefaultAllocator : Allocator { #[inline] fn norm(&self, _ : L2) -> E { @@ -247,8 +247,8 @@ for Vector where M : Dim, S : StorageMut, - E : Float + Scalar + ClosedMul + ClosedAdd + Zero + One + RealField, - DefaultAllocator : Allocator { + E : Float + Scalar + Zero + One + RealField, + DefaultAllocator : Allocator { #[inline] fn dist(&self, other : &Self, _ : L2) -> E { LpNorm(2).metric_distance(self, other) @@ -259,8 +259,8 @@ for Vector where M : Dim, S : StorageMut, - E : Float + Scalar + ClosedMul + ClosedAdd + Zero + One + RealField, - DefaultAllocator : Allocator { + E : Float + Scalar + Zero + One + RealField, + DefaultAllocator : Allocator { #[inline] fn norm(&self, _ : Linfinity) -> E { @@ -272,8 +272,8 @@ for Vector where M : Dim, S : StorageMut, - E : Float + Scalar + ClosedMul + ClosedAdd + Zero + One + RealField, - DefaultAllocator : Allocator { + E : Float + Scalar + Zero + One + RealField, + DefaultAllocator : Allocator { #[inline] fn dist(&self, other : &Self, _ : Linfinity) -> E { UniformNorm.metric_distance(self, other)