Skip to content

Commit

Permalink
as_view_mut
Browse files Browse the repository at this point in the history
  • Loading branch information
termoshtt committed Jun 28, 2019
1 parent 428e052 commit 2ba2aa0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fftw/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ impl<T> AlignedVec<T> {
{
ArrayView::from_shape(shape, self.as_slice())
}

pub fn as_view_mut<D, Shape>(&mut self, shape: Shape) -> Result<ArrayViewMut<T, D>, ShapeError>
where
D: Dimension,
Shape: Into<StrideShape<D>>,
{
ArrayViewMut::from_shape(shape, self.as_slice_mut())
}
}

impl<T> Deref for AlignedVec<T> {
Expand Down

0 comments on commit 2ba2aa0

Please sign in to comment.