ndarray
ndarray copied to clipboard
Add in-place variants of dimension-changing operations for dynamic-dimensional arrays
The .remove_axis(), .insert_axis(), .into_subview(), and .slice_move() methods do not currently have in-place variants that change the number of dimensions, because for fixed-dimensionality arrays the type changes when changing the number of dimensions. However, dynamic-dimensional arrays do not have this limitation. It would be useful to have variants of these methods for dynamic-dimensional arrays that take &mut self instead of self as the argument.
See #425 for some discussion.
Thanks for filing these issues
Status update:
-
~
.remove_axis()has been deprecated, and we shouldn't add an in-place variant of it.~ -
.insert_axis_inplace()(in-place variant of.insert_axis()) was added in #537. -
.index_axis_inplace()(in-place variant of.into_subview()) was added in #537. -
So, the only one we're missing is an in-place variant of
.slice_move(). We'll leave.slice_inplace()deprecated for a while, then remove it, then wait a while, then add.slice_inplace()forIxDynarrays that removes axes like.slice_move()does.