Some of you may have noticed that I recently released an ArrayViews package:
https://github.com/lindahua/ArrayViews.jl
Here are the main features (copied from the readme):
- An efficient
view
function that implements array views - Support of arrays of arbitrary dimension and arbitrary combinations of indexers
- Support view composition (i.e. construct views over views)
- Special attention to ensure type stability in most cases
- Efficient indexing (both cartesian and linear)
- Light weight view construction
- A systematic approach to detect contiguous views (statically)
- Views work with linear algebra functions
I am also making a PR at
#5556 to push this to the Julia Base. Given that the PR is large, it may take a while to review. In the mean-time, please checkout the package.
Related to this, I modified
NumericExtensions.jl, which is now tagged 0.4.0, and deprecate the ``unsafe_view`` function. I replaced all the use of ``unsafe_view`` in this package with a much safer version ``view`` and sees no obvious performance regression in my benchmarks. This indicates that the array view system should be efficient enough for general use.