Skip to content

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented Jun 28, 2023

After this,

julia> r = rand(2,2)
2×2 Matrix{Float64}:
 0.681849  0.273193
 0.848369  0.335195

julia> r[BlockRange(r)]
2×2 Matrix{Float64}:
 0.681849  0.273193
 0.848369  0.335195

This also defines parent for a PseudoBlockArray to extract the wrapped array.

julia> P = PseudoBlockArray([1:6;], 1:3)
3-blocked 6-element PseudoBlockVector{Int64, Vector{Int64}, Tuple{BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}}}}:
 12
 34
 5
 6

julia> parent(P)
6-element Vector{Int64}:
 1
 2
 3
 4
 5
 6

parent differs from Array, as this doesn't create a copy. This PR shouldn't be a breaking change, as P == parent(P) still holds, and the new definition matches the docstring of parent.

@jishnub jishnub merged commit 7b83868 into JuliaArrays:master Jun 29, 2023
@jishnub jishnub deleted the BlockRangeAbsArray branch June 29, 2023 04:07
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 this pull request may close these issues.

1 participant