-
Notifications
You must be signed in to change notification settings - Fork 31
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
Definition of BlockUnitRange #373
Comments
See #348, which generalizes a julia> b = blockedrange(Ones(Int,3))
3-blocked 3-element BlockedOneTo{Base.OneTo{Int64}}:
1
─
2
─
3
julia> blocklasts(b)
Base.OneTo(3)
julia> blockfirsts(b)
Base.OneTo(3)
julia> blocklengths(b)
3-element Ones{Int64}
julia> b = blockedrange(Fill(2,3))
3-blocked 6-element BlockedOneTo{StepRangeLen{Int64, Int64, Int64, Int64}}:
1
2
─
3
4
─
5
6
julia> blocklengths(b)
3-element Fill{Int64}, with entries equal to 2
julia> blockfirsts(b)
1:2:5
julia> blocklasts(b)
2:2:6 |
This proposal is not about the first entry of the range. It's rather about the first block being separately processed. |
Could you create a PR with this change to |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A single
firsts
field should work, where the last index of the range isfirsts[end]-1
. The advantages are:blocklengths(::BlockUnitRange{<:AbstractUnitRange})
is clearly aFill
andblocklengths(::BlockUnitRange{<:AbstractRange})
is aVcat(::Int,::Fill)
. reference:BlockArrays.jl/src/blockaxis.jl
Lines 449 to 468 in 2c86412
The text was updated successfully, but these errors were encountered: