# HG changeset patch # User Tuomo Valkonen # Date 1756844310 18000 # Node ID e7920e205785a66ff51ffe731aef4fa25a109683 # Parent 279b1f5b860835724f879797b261f95438d7bfba Viewable hack not needed now diff -r 279b1f5b8608 -r e7920e205785 src/nalgebra_support.rs --- a/src/nalgebra_support.rs Tue Sep 02 15:11:35 2025 -0500 +++ b/src/nalgebra_support.rs Tue Sep 02 15:18:30 2025 -0500 @@ -94,57 +94,11 @@ #[derive(Copy, Clone, Debug)] pub struct MatrixDecomposition; -/// nalgebra [`Storage`] that's convertible to dynamic strides (practically all, but we need this -/// to work around the type system). -trait ViewableStorage: Storage -where - M: Dim, - K: Dim, - E: Scalar, - ShapeConstraint: StridesOk, - DefaultAllocator: Allocator, -{ -} - -impl ViewableStorage for S +impl Decomposition> for MatrixDecomposition where S: Storage, M: Dim, K: Dim, - E: Scalar, - ShapeConstraint: StridesOk, - DefaultAllocator: Allocator, -{ -} - -/// nalgebra [`StorageMut`] that's convertible to dynamic strides (practically all, but we need this -/// to work around the type system). -trait ViewableStorageMut: StorageMut -where - M: Dim, - K: Dim, - E: Scalar, - ShapeConstraint: StridesOk, - DefaultAllocator: Allocator, -{ -} - -impl ViewableStorageMut for S -where - S: StorageMut, - M: Dim, - K: Dim, - E: Scalar, - ShapeConstraint: StridesOk, - DefaultAllocator: Allocator, -{ -} - -impl Decomposition> for MatrixDecomposition -where - S: ViewableStorage, - M: Dim, - K: Dim, E: Scalar + Zero + One, DefaultAllocator: Allocator, ShapeConstraint: StridesOk + StridesOk, @@ -171,8 +125,8 @@ impl Instance, MatrixDecomposition> for Matrix where - S1: ViewableStorage, - S2: ViewableStorage, + S1: Storage, + S2: Storage, M: Dim, K: Dim, E: Scalar + Zero + One, @@ -206,8 +160,8 @@ impl<'a, S1, S2, M, K, E> Instance, MatrixDecomposition> for &'a Matrix where - S1: ViewableStorage, - S2: ViewableStorage, + S1: Storage, + S2: Storage, M: Dim, K: Dim, E: Scalar + Zero + One, @@ -240,8 +194,8 @@ impl Mapping> for Matrix where - SM: ViewableStorage, - SV: ViewableStorage + Clone, + SM: Storage, + SV: Storage + Clone, N: Dim, M: Dim, K: Dim, @@ -259,8 +213,8 @@ impl<'a, SM, SV, N, M, K, E> Linear> for Matrix where - SM: ViewableStorage, - SV: ViewableStorage + Clone, + SM: Storage, + SV: Storage + Clone, N: Dim, M: Dim, K: Dim, @@ -273,9 +227,9 @@ impl GEMV, Matrix> for Matrix where - SM: ViewableStorage, - SV1: ViewableStorage + Clone, - SV2: ViewableStorageMut, + SM: Storage, + SV1: Storage + Clone, + SV2: StorageMut, N: Dim, M: Dim, K: Dim, @@ -302,7 +256,7 @@ impl VectorSpace for Matrix where - S: ViewableStorage, + S: Storage, M: Dim, N: Dim, E: Scalar + Zero + One + Float, @@ -321,8 +275,8 @@ impl AXPY> for Matrix where - SM: ViewableStorageMut, - SV1: ViewableStorage, + SM: StorageMut, + SV1: Storage, M: Dim, N: Dim, E: Scalar + Zero + One + Float, @@ -368,7 +322,7 @@ impl Projection for Vector where - SM: ViewableStorageMut + Clone, + SM: StorageMut + Clone, M: Dim, E: Scalar + Zero + One + Float + RealField, DefaultAllocator: Allocator, @@ -384,7 +338,7 @@ impl ProjectionMut for Vector where - SM: ViewableStorageMut + Clone, + SM: StorageMut + Clone, M: Dim, E: Scalar + Zero + One + Float + RealField, DefaultAllocator: Allocator, @@ -400,9 +354,9 @@ impl<'own, SV1, SV2, SM, N, M, K, E> Adjointable, Matrix> for Matrix where - SM: ViewableStorage, - SV1: ViewableStorage + Clone, - SV2: ViewableStorage + Clone, + SM: Storage, + SV1: Storage + Clone, + SV2: Storage + Clone, N: Dim, M: Dim, K: Dim, @@ -453,7 +407,7 @@ impl Euclidean for Vector where M: Dim, - S: ViewableStorage, + S: Storage, E: Float + Scalar + Zero + One + RealField, DefaultAllocator: Allocator, ShapeConstraint: StridesOk, @@ -479,7 +433,7 @@ impl StaticEuclidean for Vector where M: DimName, - S: ViewableStorage, + S: Storage, E: Float + Scalar + Zero + One + RealField, DefaultAllocator: Allocator, ShapeConstraint: StridesOk, @@ -494,7 +448,7 @@ impl Normed for Vector where M: Dim, - S: ViewableStorage, + S: Storage, E: Float + Scalar + Zero + One + RealField, DefaultAllocator: Allocator, ShapeConstraint: StridesOk, @@ -515,7 +469,7 @@ impl HasDual for Vector where M: Dim, - S: ViewableStorage, + S: Storage, E: Float + Scalar + Zero + One + RealField, DefaultAllocator: Allocator, ShapeConstraint: StridesOk, @@ -530,7 +484,7 @@ impl Norm for Vector where M: Dim, - S: ViewableStorage, + S: Storage, E: Float + Scalar + Zero + One + RealField, DefaultAllocator: Allocator, ShapeConstraint: StridesOk, @@ -544,7 +498,7 @@ impl Dist for Vector where M: Dim, - S: ViewableStorage + Clone, + S: Storage + Clone, E: Float + Scalar + Zero + One + RealField, DefaultAllocator: Allocator, ShapeConstraint: StridesOk, @@ -558,7 +512,7 @@ impl Norm for Vector where M: Dim, - S: ViewableStorage, + S: Storage, E: Float + Scalar + Zero + One + RealField, DefaultAllocator: Allocator, ShapeConstraint: StridesOk, @@ -572,7 +526,7 @@ impl Dist for Vector where M: Dim, - S: ViewableStorage + Clone, + S: Storage + Clone, E: Float + Scalar + Zero + One + RealField, DefaultAllocator: Allocator, ShapeConstraint: StridesOk, @@ -586,7 +540,7 @@ impl Norm for Vector where M: Dim, - S: ViewableStorage, + S: Storage, E: Float + Scalar + Zero + One + RealField, DefaultAllocator: Allocator, ShapeConstraint: StridesOk, @@ -600,7 +554,7 @@ impl Dist for Vector where M: Dim, - S: ViewableStorage + Clone, + S: Storage + Clone, E: Float + Scalar + Zero + One + RealField, DefaultAllocator: Allocator, ShapeConstraint: StridesOk,