You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose I have an arbitrary array; any model of ownership, any number of dimensions, possibly non-contiguous, with strides in whatever order. How do I get an owned array in standard layout? And could it be better documented?
Based on the documentation of ArrayBase alone, it seems to me that the following is the only safe bet:
Yeah, that's the simplest way, I think. The other obvious things to try (.to_owned() and .map()/.mapv()) don't alter the layout of contiguous arrays, so they don't help in this case.
Something like this might be faster for handling contiguous arrays in standard layout, but you'd have to benchmark to know for sure:
It would be nice in the future to provide a more concise way to convert between memory layouts, possibly using something like the Cow-like types described in #390.
Suppose I have an arbitrary array; any model of ownership, any number of dimensions, possibly non-contiguous, with strides in whatever order. How do I get an owned array in standard layout? And could it be better documented?
Based on the documentation of ArrayBase alone, it seems to me that the following is the only safe bet:
The text was updated successfully, but these errors were encountered: