Linear indexing into block arrays
This issue relates to #168, where linear indices in a BlockIndex led to a stack overflow.
A question that arises is whether linear indexing should be supported and if so, how. Currently, there is this behaviour:
julia> using BlockArrays
A = [1 2; 3 4]
julia> A = [1 2; 3 4]
2×2 Array{Int64,2}:
1 2
3 4
julia> A[Block(1,1)]
2×2 Array{Int64,2}:
1 2
3 4
julia> A[Block(1)]
2-element Array{Int64,1}:
1
3
julia> A[Block(2)]
ERROR: BlockBoundsError: attempt to access 2-element Base.OneTo{Int64} at block index [2]
Indexing a matrix with Block(1) yields the first column only, but Block(2) does not yield the second column. The blocksize of the matrix is 1 indicating that A[Block(1)] == A may be more consistent. But that would be an incompatible change.
You are right, I consider that to be a bug (bug fixes are not breaking)
Okay, I'll try to look into it, if it doesn't become too comprehensive. I'm not very familiar with BlockArrays.jl yet, though for another package the functionality is just what I need.
That was doable, I updated the pull request #168.