From 4f803b8bd38712aa25228c701c0ba316182b652a Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Fri, 28 Jun 2019 14:38:29 +0900 Subject: [PATCH] as_view_mut --- fftw/src/array.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fftw/src/array.rs b/fftw/src/array.rs index 70c2b625..745a1fbe 100644 --- a/fftw/src/array.rs +++ b/fftw/src/array.rs @@ -64,6 +64,14 @@ impl AlignedVec { { ArrayView::from_shape(shape, self.as_slice()) } + + pub fn as_view_mut(&mut self, shape: Shape) -> Result, ShapeError> + where + D: Dimension, + Shape: Into>, + { + ArrayViewMut::from_shape(shape, self.as_slice_mut()) + } } impl Deref for AlignedVec {