You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes this is not intentional, didn't think about this case when designing the code, and surprised it doesn't error out.
The way I would fix this is to first get it working on views and then use ArrayLayouts.jl approach of materializing a view (adding getindex(a::AbstractArray, K::Block{1}) = layout_getindex(a, K) will materialize a view).
What goes wrong with views is that it tries to reshape to a vector:
julia>view(a,Block(1))
1-element view(reshape(::PseudoBlockArray{Float64,2,Array{Float64,2},Tuple{BlockedUnitRange{Array{Int64,1}},BlockedUnitRange{Array{Int64,1}}}}, 15), BlockSlice(Block(1),1:1)) with eltype Float64:1.0
Probably an overload of _maybe_reshape_parent will help, though we'll need to add support for block ReshapedArrays.
For a matrix
M
, we haveM[1, 1] == M[1]
. However, similar indexing withBlock
seems to be broken:I expect
A[Block(1)]
andA[Block(1), Block(1)]
above to return equivalent matrices. (Or throwing withA[Block(1)]
might be OK.)This is also true with
BlockArray
:The text was updated successfully, but these errors were encountered: