ndarray icon indicating copy to clipboard operation
ndarray copied to clipboard

Add in-place variants of dimension-changing operations for dynamic-dimensional arrays

Open jturner314 opened this issue 7 years ago • 2 comments

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.

jturner314 avatar Mar 19 '18 23:03 jturner314

Thanks for filing these issues

bluss avatar Mar 20 '18 19:03 bluss

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() for IxDyn arrays that removes axes like .slice_move() does.

jturner314 avatar Mar 26 '19 02:03 jturner314