Skip to content
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

Any interest in a uvec method? #6

Closed
m-wells opened this issue Nov 8, 2019 · 2 comments
Closed

Any interest in a uvec method? #6

m-wells opened this issue Nov 8, 2019 · 2 comments

Comments

@m-wells
Copy link

m-wells commented Nov 8, 2019

Is there any interest in a uvec method? I imagine it would be something like

uvec(x::AbstractArray) = uview(x, eachindex(x))
@oschulz
Copy link
Collaborator

oschulz commented Nov 11, 2019

You can already call vec on an UnsafeArray:

using UnsafeArrays
A = rand(4, 6)
@uviews A begin
    va = vec(A)
    va isa UnsafeArray{Float64,1}
end

So I don't think we need a special uvec function. Also, in general, uview should rarely be used directly - use the @uviews macro instead, it protectd the original arrays from GC.

@oschulz oschulz closed this as completed Nov 11, 2019
@oschulz
Copy link
Collaborator

oschulz commented Nov 11, 2019

If you had something more specialized in mind, though, please feel free to reopen this issue, @m-wells!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants