-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: A systematic array view framework #5513
Comments
This looks really systematic. How does the performance on your benchmarks compare currently? |
@lindahua: This looks fantastic! hopefully this gets in for 0.3 and replaces getindex/setindex! for regular arrays |
@ViralBShah: Here is a brief summary of my benchmark results obtained so far:
cc: @StefanKarpinski |
Very nice. Could ArrayViews allow to iterate over the contiguous |
The package is basically ready. Now it supports view composition (i.e. views over views) and works well with linear algebra functions. I think it is ready to be migrated to the Base. @mschauer The interface of To iterate over sub slices, one may do a = rand(m, n, k)
for i = 1 : size(a, 3)
do_something(view(a,:,:,i))
end This is more efficient than using |
Ah, that is good, these contiguous subarrays were a bit underprivileged in Julia compared to APL and J, where operations on those are very well integrated... I guess you know by your usage of the term [rank](http://en.wikipedia.org/wiki/Rank_(J_programming_language%29) . Here also #5405 applies because the syntax changes with the number of dimensions which makes it a bit inflexible. |
For #5405, I like the ellipsis notation. Until that lands, I am not able to support the notation like However, it is possible to add something like |
Close in favor of the PR at #5556. Please move the discussions there. |
Efficient array views have been a long standing issue in Julia. Recently, I decided to tackle this problem again, and for this purpose, created a package ArrayViews.jl to explore a generic & efficient approach.
There remains some work to be done, but the framework is largely there. While I will continue to work on this package, I would like to solicit comments here.
The ultimate goal is to move this to the Base when it is ready, to take the place of the current subarray system.
An important feature of this approach is that it has two view types
ContiguousView
andStridedView
. Each strided view is associated with a static number called contiguous rank, which can be used to determine (statically) the contiguousness of a subview thereof.A contiguous view (with more compact representation and faster indexing) will be returned whenever the contiguousness of a view can be determined statically, thus substantially improving indexing efficiency in a lot of common situations.
The text was updated successfully, but these errors were encountered: