I really wanted to avoid implementing ArrayView for Ndarr due to the unavoidable unsafe code. But at the end of the day it is a well tested strategy, and it will help a lot to improve the performance of many operations. But most importantly, if we want to eventually implement mutable slicing, I think there is no other way.
The idea of an ArrayView as far as I understand it, is sort of a reference to a Ndarr. It holds a pointer to the beginning of the Ndarr data, the shape and stride that can be calculated with the shape itself.
I really wanted to avoid implementing ArrayView for Ndarr due to the unavoidable unsafe code. But at the end of the day it is a well tested strategy, and it will help a lot to improve the performance of many operations. But most importantly, if we want to eventually implement mutable slicing, I think there is no other way.
The idea of an ArrayView as far as I understand it, is sort of a reference to a Ndarr. It holds a pointer to the beginning of the
Ndarr
data, the shape and stride that can be calculated with the shape itself.