From c8dfb5e348432508d6c8bd58bfe3fd7ab0290e1a Mon Sep 17 00:00:00 2001 From: Andreas Longva Date: Fri, 11 Nov 2022 15:46:04 +0100 Subject: [PATCH] Rename SliceStorage(Mut) to ViewStorage(Mut) Additionally, we add type aliases with the old names to maintain backwards compatibility with deprecation warnings. --- src/base/alias_slice.rs | 242 ++++++++++++++++----------------- src/base/construction_slice.rs | 6 +- src/base/conversion.rs | 8 +- src/base/indexing.rs | 8 +- src/base/matrix_slice.rs | 89 ++++++------ 5 files changed, 182 insertions(+), 171 deletions(-) diff --git a/src/base/alias_slice.rs b/src/base/alias_slice.rs index 929d2f03..21cde51c 100644 --- a/src/base/alias_slice.rs +++ b/src/base/alias_slice.rs @@ -1,5 +1,5 @@ use crate::base::dimension::{Dynamic, U1, U2, U3, U4, U5, U6}; -use crate::base::matrix_slice::{SliceStorage, SliceStorageMut}; +use crate::base::matrix_slice::{ViewStorage, ViewStorageMut}; use crate::base::{Const, Matrix}; /* @@ -14,285 +14,285 @@ use crate::base::{Const, Matrix}; /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type SMatrixSlice<'a, T, const R: usize, const C: usize> = - Matrix, Const, SliceStorage<'a, T, Const, Const, Const<1>, Const>>; + Matrix, Const, ViewStorage<'a, T, Const, Const, Const<1>, Const>>; /// A column-major matrix slice dynamic numbers of rows and columns. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type DMatrixSlice<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A column-major 1x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice1<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A column-major 2x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice2<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A column-major 3x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice3<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A column-major 4x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice4<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A column-major 5x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice5<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A column-major 6x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice6<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /// A column-major 1x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice1x2<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A column-major 1x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice1x3<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A column-major 1x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice1x4<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A column-major 1x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice1x5<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A column-major 1x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice1x6<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A column-major 2x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice2x1<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A column-major 2x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice2x3<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A column-major 2x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice2x4<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A column-major 2x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice2x5<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A column-major 2x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice2x6<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A column-major 3x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice3x1<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A column-major 3x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice3x2<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A column-major 3x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice3x4<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A column-major 3x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice3x5<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A column-major 3x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice3x6<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A column-major 4x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice4x1<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A column-major 4x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice4x2<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A column-major 4x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice4x3<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A column-major 4x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice4x5<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A column-major 4x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice4x6<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A column-major 5x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice5x1<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A column-major 5x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice5x2<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A column-major 5x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice5x3<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A column-major 5x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice5x4<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A column-major 5x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice5x6<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A column-major 6x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice6x1<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /// A column-major 6x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice6x2<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /// A column-major 6x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice6x3<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /// A column-major 6x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice6x4<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /// A column-major 6x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSlice6x5<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /// A column-major matrix slice with 1 row and a number of columns chosen at runtime. pub type MatrixSlice1xX<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A column-major matrix slice with 2 rows and a number of columns chosen at runtime. pub type MatrixSlice2xX<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A column-major matrix slice with 3 rows and a number of columns chosen at runtime. pub type MatrixSlice3xX<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A column-major matrix slice with 4 rows and a number of columns chosen at runtime. pub type MatrixSlice4xX<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A column-major matrix slice with 5 rows and a number of columns chosen at runtime. pub type MatrixSlice5xX<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A column-major matrix slice with 6 rows and a number of columns chosen at runtime. pub type MatrixSlice6xX<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 1 column. pub type MatrixSliceXx1<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 2 columns. pub type MatrixSliceXx2<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 3 columns. pub type MatrixSliceXx3<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 4 columns. pub type MatrixSliceXx4<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 5 columns. pub type MatrixSliceXx5<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 6 columns. pub type MatrixSliceXx6<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A column vector slice with dimensions known at compile-time. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type VectorSlice<'a, T, D, RStride = U1, CStride = D> = - Matrix>; + Matrix>; /// A column vector slice with dimensions known at compile-time. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type SVectorSlice<'a, T, const D: usize> = - Matrix, Const<1>, SliceStorage<'a, T, Const, Const<1>, Const<1>, Const>>; + Matrix, Const<1>, ViewStorage<'a, T, Const, Const<1>, Const<1>, Const>>; /// A column vector slice dynamic numbers of rows and columns. pub type DVectorSlice<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A 1D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type VectorSlice1<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A 2D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type VectorSlice2<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A 3D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type VectorSlice3<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A 4D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type VectorSlice4<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A 5D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type VectorSlice5<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A 6D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type VectorSlice6<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /* * @@ -305,296 +305,296 @@ pub type VectorSlice6<'a, T, RStride = U1, CStride = U6> = /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMutMN<'a, T, R, C, RStride = U1, CStride = R> = - Matrix>; + Matrix>; /// A column-major matrix slice with `D` rows and columns. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMutN<'a, T, D, RStride = U1, CStride = D> = - Matrix>; + Matrix>; /// A column-major matrix slice with dimensions known at compile-time. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type SMatrixSliceMut<'a, T, const R: usize, const C: usize> = - Matrix, Const, SliceStorageMut<'a, T, Const, Const, Const<1>, Const>>; + Matrix, Const, ViewStorageMut<'a, T, Const, Const, Const<1>, Const>>; /// A column-major matrix slice dynamic numbers of rows and columns. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type DMatrixSliceMut<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A column-major 1x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut1<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A column-major 2x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut2<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A column-major 3x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut3<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A column-major 4x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut4<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A column-major 5x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut5<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A column-major 6x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut6<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /// A column-major 1x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut1x2<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A column-major 1x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut1x3<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A column-major 1x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut1x4<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A column-major 1x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut1x5<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A column-major 1x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut1x6<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A column-major 2x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut2x1<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A column-major 2x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut2x3<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A column-major 2x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut2x4<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A column-major 2x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut2x5<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A column-major 2x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut2x6<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A column-major 3x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut3x1<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A column-major 3x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut3x2<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A column-major 3x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut3x4<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A column-major 3x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut3x5<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A column-major 3x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut3x6<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A column-major 4x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut4x1<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A column-major 4x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut4x2<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A column-major 4x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut4x3<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A column-major 4x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut4x5<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A column-major 4x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut4x6<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A column-major 5x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut5x1<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A column-major 5x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut5x2<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A column-major 5x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut5x3<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A column-major 5x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut5x4<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A column-major 5x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut5x6<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A column-major 6x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut6x1<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /// A column-major 6x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut6x2<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /// A column-major 6x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut6x3<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /// A column-major 6x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut6x4<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /// A column-major 6x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type MatrixSliceMut6x5<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /// A column-major matrix slice with 1 row and a number of columns chosen at runtime. pub type MatrixSliceMut1xX<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A column-major matrix slice with 2 rows and a number of columns chosen at runtime. pub type MatrixSliceMut2xX<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A column-major matrix slice with 3 rows and a number of columns chosen at runtime. pub type MatrixSliceMut3xX<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A column-major matrix slice with 4 rows and a number of columns chosen at runtime. pub type MatrixSliceMut4xX<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A column-major matrix slice with 5 rows and a number of columns chosen at runtime. pub type MatrixSliceMut5xX<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A column-major matrix slice with 6 rows and a number of columns chosen at runtime. pub type MatrixSliceMut6xX<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 1 column. pub type MatrixSliceMutXx1<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 2 columns. pub type MatrixSliceMutXx2<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 3 columns. pub type MatrixSliceMutXx3<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 4 columns. pub type MatrixSliceMutXx4<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 5 columns. pub type MatrixSliceMutXx5<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 6 columns. pub type MatrixSliceMutXx6<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A column vector slice with dimensions known at compile-time. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type VectorSliceMut<'a, T, D, RStride = U1, CStride = D> = - Matrix>; + Matrix>; /// A column vector slice with dimensions known at compile-time. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type SVectorSliceMut<'a, T, const D: usize> = - Matrix, Const<1>, SliceStorageMut<'a, T, Const, Const<1>, Const<1>, Const>>; + Matrix, Const<1>, ViewStorageMut<'a, T, Const, Const<1>, Const<1>, Const>>; /// A column vector slice dynamic numbers of rows and columns. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type DVectorSliceMut<'a, T, RStride = U1, CStride = Dynamic> = - Matrix>; + Matrix>; /// A 1D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type VectorSliceMut1<'a, T, RStride = U1, CStride = U1> = - Matrix>; + Matrix>; /// A 2D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type VectorSliceMut2<'a, T, RStride = U1, CStride = U2> = - Matrix>; + Matrix>; /// A 3D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type VectorSliceMut3<'a, T, RStride = U1, CStride = U3> = - Matrix>; + Matrix>; /// A 4D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type VectorSliceMut4<'a, T, RStride = U1, CStride = U4> = - Matrix>; + Matrix>; /// A 5D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type VectorSliceMut5<'a, T, RStride = U1, CStride = U5> = - Matrix>; + Matrix>; /// A 6D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** pub type VectorSliceMut6<'a, T, RStride = U1, CStride = U6> = - Matrix>; + Matrix>; diff --git a/src/base/construction_slice.rs b/src/base/construction_slice.rs index 7094bdca..aad50685 100644 --- a/src/base/construction_slice.rs +++ b/src/base/construction_slice.rs @@ -1,5 +1,5 @@ use crate::base::dimension::{Const, Dim, DimName, Dynamic}; -use crate::base::matrix_slice::{SliceStorage, SliceStorageMut}; +use crate::base::matrix_slice::{ViewStorage, ViewStorageMut}; use crate::base::{MatrixSlice, MatrixSliceMutMN, Scalar}; use num_rational::Ratio; @@ -22,7 +22,7 @@ impl<'a, T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> rstride: RStride, cstride: CStride, ) -> Self { - let data = SliceStorage::from_raw_parts( + let data = ViewStorage::from_raw_parts( data.as_ptr().add(start), (nrows, ncols), (rstride, cstride), @@ -160,7 +160,7 @@ impl<'a, T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> rstride: RStride, cstride: CStride, ) -> Self { - let data = SliceStorageMut::from_raw_parts( + let data = ViewStorageMut::from_raw_parts( data.as_mut_ptr().add(start), (nrows, ncols), (rstride, cstride), diff --git a/src/base/conversion.rs b/src/base/conversion.rs index dd71186f..26e624a3 100644 --- a/src/base/conversion.rs +++ b/src/base/conversion.rs @@ -21,7 +21,7 @@ use crate::base::{ }; #[cfg(any(feature = "std", feature = "alloc"))] use crate::base::{DVector, RowDVector, VecStorage}; -use crate::base::{SliceStorage, SliceStorageMut}; +use crate::base::{ViewStorage, ViewStorageMut}; use crate::constraint::DimEq; use crate::{IsNotStaticOne, RowSVector, SMatrix, SVector, VectorSlice, VectorSliceMut}; use std::mem::MaybeUninit; @@ -397,7 +397,7 @@ where let cstride_slice = CStride::from_usize(cstride); unsafe { - let data = SliceStorage::from_raw_parts( + let data = ViewStorage::from_raw_parts( m.data.ptr(), (row_slice, col_slice), (rstride_slice, cstride_slice), @@ -434,7 +434,7 @@ where let cstride_slice = CStride::from_usize(cstride); unsafe { - let data = SliceStorage::from_raw_parts( + let data = ViewStorage::from_raw_parts( m.data.ptr(), (row_slice, col_slice), (rstride_slice, cstride_slice), @@ -471,7 +471,7 @@ where let cstride_slice = CStride::from_usize(cstride); unsafe { - let data = SliceStorageMut::from_raw_parts( + let data = ViewStorageMut::from_raw_parts( m.data.ptr_mut(), (row_slice, col_slice), (rstride_slice, cstride_slice), diff --git a/src/base/indexing.rs b/src/base/indexing.rs index 2c691bd1..5cc64db0 100644 --- a/src/base/indexing.rs +++ b/src/base/indexing.rs @@ -682,13 +682,13 @@ macro_rules! impl_index_pair { #[doc(hidden)] #[inline(always)] unsafe fn get_unchecked(self, matrix: &'a Matrix) -> Self::Output { - use crate::base::SliceStorage; + use crate::base::ViewStorage; let (rows, cols) = self; let (nrows, ncols) = matrix.shape_generic(); let data = - SliceStorage::new_unchecked(&matrix.data, + ViewStorage::new_unchecked(&matrix.data, (rows.lower(nrows), cols.lower(ncols)), (rows.length(nrows), cols.length(ncols))); @@ -710,13 +710,13 @@ macro_rules! impl_index_pair { #[doc(hidden)] #[inline(always)] unsafe fn get_unchecked_mut(self, matrix: &'a mut Matrix) -> Self::OutputMut { - use crate::base::SliceStorageMut; + use crate::base::ViewStorageMut; let (rows, cols) = self; let (nrows, ncols) = matrix.shape_generic(); let data = - SliceStorageMut::new_unchecked(&mut matrix.data, + ViewStorageMut::new_unchecked(&mut matrix.data, (rows.lower(nrows), cols.lower(ncols)), (rows.length(nrows), cols.length(ncols))); diff --git a/src/base/matrix_slice.rs b/src/base/matrix_slice.rs index 5fbd4b01..be646cee 100644 --- a/src/base/matrix_slice.rs +++ b/src/base/matrix_slice.rs @@ -9,17 +9,28 @@ use crate::base::iter::MatrixIter; use crate::base::storage::{IsContiguous, Owned, RawStorage, RawStorageMut, Storage}; use crate::base::{Matrix, Scalar}; -macro_rules! slice_storage_impl( - ($doc: expr; $Storage: ident as $SRef: ty; $T: ident.$get_addr: ident ($Ptr: ty as $Ref: ty)) => { +macro_rules! view_storage_impl ( + ($doc: expr; $Storage: ident as $SRef: ty; $legacy_name:ident => $T: ident.$get_addr: ident ($Ptr: ty as $Ref: ty)) => { #[doc = $doc] #[derive(Debug)] - pub struct $T<'a, T, R: Dim, C: Dim, RStride: Dim, CStride: Dim> { + pub struct $T<'a, T, R: Dim, C: Dim, RStride: Dim, CStride: Dim> { ptr: $Ptr, shape: (R, C), strides: (RStride, CStride), _phantoms: PhantomData<$Ref>, } + #[doc = $doc] + /// + /// This type alias exists only for legacy purposes and is deprecated. It will be removed + /// in a future release. Please use + /// [` + #[doc = stringify!($T)] + /// `] instead. See [issue #1076](https://github.com/dimforge/nalgebra/issues/1076) + /// for the rationale. + #[deprecated = "Use ViewStorage(Mut) instead."] + pub type $legacy_name<'a, T, R, C, RStride, CStride> = $T<'a, T, R, C, RStride, CStride>; + unsafe impl<'a, T: Send, R: Dim, C: Dim, RStride: Dim, CStride: Dim> Send for $T<'a, T, R, C, RStride, CStride> {} @@ -29,7 +40,7 @@ macro_rules! slice_storage_impl( {} impl<'a, T, R: Dim, C: Dim, RStride: Dim, CStride: Dim> $T<'a, T, R, C, RStride, CStride> { - /// Create a new matrix slice without bound checking and from a raw pointer. + /// Create a new matrix view without bounds checking and from a raw pointer. #[inline] pub unsafe fn from_raw_parts(ptr: $Ptr, shape: (R, C), @@ -49,7 +60,7 @@ macro_rules! slice_storage_impl( // Dynamic is arbitrary. It's just to be able to call the constructors with `Slice::` impl<'a, T, R: Dim, C: Dim> $T<'a, T, R, C, Dynamic, Dynamic> { - /// Create a new matrix slice without bound checking. + /// Create a new matrix view without bounds checking. #[inline] pub unsafe fn new_unchecked(storage: $SRef, start: (usize, usize), shape: (R, C)) -> $T<'a, T, R, C, S::RStride, S::CStride> @@ -61,7 +72,7 @@ macro_rules! slice_storage_impl( $T::new_with_strides_unchecked(storage, start, shape, strides) } - /// Create a new matrix slice without bound checking. + /// Create a new matrix view without bounds checking. #[inline] pub unsafe fn new_with_strides_unchecked(storage: $SRef, start: (usize, usize), @@ -82,7 +93,7 @@ macro_rules! slice_storage_impl( where Self: RawStorage + IsContiguous { - /// Extracts the original slice from this storage + /// Extracts the original slice from this storage. pub fn into_slice(self) -> &'a [T] { let (nrows, ncols) = self.shape(); if nrows.value() != 0 && ncols.value() != 0 { @@ -96,22 +107,22 @@ macro_rules! slice_storage_impl( } ); -slice_storage_impl!("A matrix data storage for a matrix slice. Only contains an internal reference \ +view_storage_impl!("A matrix data storage for a matrix view. Only contains an internal reference \ to another matrix data storage."; - RawStorage as &'a S; SliceStorage.get_address_unchecked(*const T as &'a T)); + RawStorage as &'a S; SliceStorage => ViewStorage.get_address_unchecked(*const T as &'a T)); -slice_storage_impl!("A mutable matrix data storage for mutable matrix slice. Only contains an \ +view_storage_impl!("A mutable matrix data storage for mutable matrix view. Only contains an \ internal mutable reference to another matrix data storage."; - RawStorageMut as &'a mut S; SliceStorageMut.get_address_unchecked_mut(*mut T as &'a mut T) + RawStorageMut as &'a mut S; SliceStorageMut => ViewStorageMut.get_address_unchecked_mut(*mut T as &'a mut T) ); impl<'a, T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> Copy - for SliceStorage<'a, T, R, C, RStride, CStride> + for ViewStorage<'a, T, R, C, RStride, CStride> { } impl<'a, T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> Clone - for SliceStorage<'a, T, R, C, RStride, CStride> + for ViewStorage<'a, T, R, C, RStride, CStride> { #[inline] fn clone(&self) -> Self { @@ -125,7 +136,7 @@ impl<'a, T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> Clone } impl<'a, T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> - SliceStorageMut<'a, T, R, C, RStride, CStride> + ViewStorageMut<'a, T, R, C, RStride, CStride> where Self: RawStorageMut + IsContiguous, { @@ -212,10 +223,10 @@ macro_rules! storage_impl( )*} ); -storage_impl!(SliceStorage, SliceStorageMut); +storage_impl!(ViewStorage, ViewStorageMut); unsafe impl<'a, T, R: Dim, C: Dim, RStride: Dim, CStride: Dim> RawStorageMut - for SliceStorageMut<'a, T, R, C, RStride, CStride> + for ViewStorageMut<'a, T, R, C, RStride, CStride> { #[inline] fn ptr_mut(&mut self) -> *mut T { @@ -234,18 +245,18 @@ unsafe impl<'a, T, R: Dim, C: Dim, RStride: Dim, CStride: Dim> RawStorageMut IsContiguous for SliceStorage<'a, T, R, U1, U1, CStride> {} +unsafe impl<'a, T, R: Dim, CStride: Dim> IsContiguous for ViewStorage<'a, T, R, U1, U1, CStride> {} unsafe impl<'a, T, R: Dim, CStride: Dim> IsContiguous - for SliceStorageMut<'a, T, R, U1, U1, CStride> + for ViewStorageMut<'a, T, R, U1, U1, CStride> { } unsafe impl<'a, T, R: DimName, C: Dim + IsNotStaticOne> IsContiguous - for SliceStorage<'a, T, R, C, U1, R> + for ViewStorage<'a, T, R, C, U1, R> { } unsafe impl<'a, T, R: DimName, C: Dim + IsNotStaticOne> IsContiguous - for SliceStorageMut<'a, T, R, C, U1, R> + for ViewStorageMut<'a, T, R, C, U1, R> { } @@ -273,8 +284,8 @@ impl> Matrix { } } -macro_rules! matrix_slice_impl( - ($me: ident: $Me: ty, $MatrixSlice: ident, $SliceStorage: ident, $Storage: ident.$get_addr: ident (), $data: expr; +macro_rules! matrix_slice_impl ( + ($me: ident: $Me: ty, $MatrixSlice: ident, $ViewStorage: ident, $Storage: ident.$get_addr: ident (), $data: expr; $row: ident, $row_part: ident, $rows: ident, @@ -361,7 +372,7 @@ macro_rules! matrix_slice_impl( let shape = (nrows, my_shape.1); unsafe { - let data = $SliceStorage::new_unchecked($data, (row_start, 0), shape); + let data = $ViewStorage::new_unchecked($data, (row_start, 0), shape); Matrix::from_data_statically_unchecked(data) } } @@ -381,7 +392,7 @@ macro_rules! matrix_slice_impl( let shape = (nrows, my_shape.1); unsafe { - let data = $SliceStorage::new_with_strides_unchecked($data, (row_start, 0), shape, strides); + let data = $ViewStorage::new_with_strides_unchecked($data, (row_start, 0), shape, strides); Matrix::from_data_statically_unchecked(data) } } @@ -448,7 +459,7 @@ macro_rules! matrix_slice_impl( let shape = (my_shape.0, ncols); unsafe { - let data = $SliceStorage::new_unchecked($data, (0, first_col), shape); + let data = $ViewStorage::new_unchecked($data, (0, first_col), shape); Matrix::from_data_statically_unchecked(data) } } @@ -469,7 +480,7 @@ macro_rules! matrix_slice_impl( let shape = (my_shape.0, ncols); unsafe { - let data = $SliceStorage::new_with_strides_unchecked($data, (0, first_col), shape, strides); + let data = $ViewStorage::new_with_strides_unchecked($data, (0, first_col), shape, strides); Matrix::from_data_statically_unchecked(data) } } @@ -489,7 +500,7 @@ macro_rules! matrix_slice_impl( let shape = (Dynamic::new(shape.0), Dynamic::new(shape.1)); unsafe { - let data = $SliceStorage::new_unchecked($data, start, shape); + let data = $ViewStorage::new_unchecked($data, start, shape); Matrix::from_data_statically_unchecked(data) } } @@ -517,7 +528,7 @@ macro_rules! matrix_slice_impl( let shape = (Const::, Const::); unsafe { - let data = $SliceStorage::new_unchecked($data, (irow, icol), shape); + let data = $ViewStorage::new_unchecked($data, (irow, icol), shape); Matrix::from_data_statically_unchecked(data) } } @@ -543,7 +554,7 @@ macro_rules! matrix_slice_impl( $me.assert_slice_index(start, (shape.0.value(), shape.1.value()), (0, 0)); unsafe { - let data = $SliceStorage::new_unchecked($data, start, shape); + let data = $ViewStorage::new_unchecked($data, start, shape); Matrix::from_data_statically_unchecked(data) } } @@ -565,7 +576,7 @@ macro_rules! matrix_slice_impl( Dynamic::new((steps.1 + 1) * my_strides.1.value())); unsafe { - let data = $SliceStorage::new_with_strides_unchecked($data, start, shape, strides); + let data = $ViewStorage::new_with_strides_unchecked($data, start, shape, strides); Matrix::from_data_statically_unchecked(data) } } @@ -602,8 +613,8 @@ macro_rules! matrix_slice_impl( let ptr1 = $data.$get_addr(start1, 0); let ptr2 = $data.$get_addr(start2, 0); - let data1 = $SliceStorage::from_raw_parts(ptr1, (nrows1, ncols), strides); - let data2 = $SliceStorage::from_raw_parts(ptr2, (nrows2, ncols), strides); + let data1 = $ViewStorage::from_raw_parts(ptr1, (nrows1, ncols), strides); + let data2 = $ViewStorage::from_raw_parts(ptr2, (nrows2, ncols), strides); let slice1 = Matrix::from_data_statically_unchecked(data1); let slice2 = Matrix::from_data_statically_unchecked(data2); @@ -638,8 +649,8 @@ macro_rules! matrix_slice_impl( let ptr1 = $data.$get_addr(0, start1); let ptr2 = $data.$get_addr(0, start2); - let data1 = $SliceStorage::from_raw_parts(ptr1, (nrows, ncols1), strides); - let data2 = $SliceStorage::from_raw_parts(ptr2, (nrows, ncols2), strides); + let data1 = $ViewStorage::from_raw_parts(ptr1, (nrows, ncols1), strides); + let data2 = $ViewStorage::from_raw_parts(ptr2, (nrows, ncols2), strides); let slice1 = Matrix::from_data_statically_unchecked(data1); let slice2 = Matrix::from_data_statically_unchecked(data2); @@ -651,15 +662,15 @@ macro_rules! matrix_slice_impl( /// A matrix slice. pub type MatrixSlice<'a, T, R, C, RStride = U1, CStride = R> = - Matrix>; + Matrix>; /// A mutable matrix slice. pub type MatrixSliceMut<'a, T, R, C, RStride = U1, CStride = R> = - Matrix>; + Matrix>; /// # Slicing based on index and length impl> Matrix { matrix_slice_impl!( - self: &Self, MatrixSlice, SliceStorage, RawStorage.get_address_unchecked(), &self.data; + self: &Self, MatrixSlice, ViewStorage, RawStorage.get_address_unchecked(), &self.data; row, row_part, rows, @@ -689,7 +700,7 @@ impl> Matrix { /// # Mutable slicing based on index and length impl> Matrix { matrix_slice_impl!( - self: &mut Self, MatrixSliceMut, SliceStorageMut, RawStorageMut.get_address_unchecked_mut(), &mut self.data; + self: &mut Self, MatrixSliceMut, ViewStorageMut, RawStorageMut.get_address_unchecked_mut(), &mut self.data; row_mut, row_part_mut, rows_mut, @@ -943,7 +954,7 @@ where CStride: Dim, { fn from(slice_mut: MatrixSliceMut<'a, T, R, C, RStride, CStride>) -> Self { - let data = SliceStorage { + let data = ViewStorage { ptr: slice_mut.data.ptr, shape: slice_mut.data.shape, strides: slice_mut.data.strides,