JuliaArrays / FillArrays.jl

Julia package for lazily representing matrices filled with a single entry

Home Page:https://juliaarrays.github.io/FillArrays.jl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why is `IndexStyle` specialized for `Base.OneTo`?

jishnub opened this issue · comments

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.

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