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

Why is IndexStyle specialized for Base.OneTo? #195

Open
jishnub opened this issue Oct 17, 2022 · 1 comment · May be fixed by #196
Open

Why is IndexStyle specialized for Base.OneTo? #195

jishnub opened this issue Oct 17, 2022 · 1 comment · May be fixed by #196

Comments

@jishnub
Copy link
Member

jishnub commented Oct 17, 2022

IndexStyle(::Type{<:AbstractFill{<:Any,N,<:NTuple{N,Base.OneTo{Int}}}}) where N = IndexLinear()

This means

julia> using StaticArrays

julia> f = Fill(1, (SOneTo(2),))
2-element Fill{Int64, 1, Tuple{SOneTo{2}}} with indices SOneTo(2), with entries equal to 1

julia> IndexStyle(f)
IndexCartesian()

This may use linear indexing as well, though.

@dlfivefifty
Copy link
Member

I doubt there is a reason for this. Perhaps we were thinking of offset axes?

@jishnub jishnub linked a pull request Oct 17, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants