rust-ndarray / ndarray

ndarray: an N-dimensional array with array views, multidimensional slicing, and efficient operations
https://docs.rs/ndarray/
Apache License 2.0
3.43k stars 295 forks source link

Add .into_raw_vec_with_offset() and deprecate .into_raw_vec() #1379

Closed bluss closed 3 months ago

bluss commented 3 months ago

Without the offset from start of allocation to the logically first element of the array, correctly reinterpreting the results of .into_raw_vec() as an n-D array is tricky.

Provide a smoother transition by deprecating the old method and introducing a new one.

Return Option, this makes the empty vector case stand out as a separate case that needs to be handled.

Closes #994 by superseding it.

bluss commented 3 months ago

thanks for looking at this