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
We have two different versions of getting a block without copying: getblock(A, k::Int...) and view(A, ::Block...). I propose deprecating getblock and having the canonical version the latter. Note this would mean view does not (always) return a SubArray, but this is fine:
julia>view(2:5, 2:3) # returns a range as type is immutable3:4
Note this might break some code: I recall for PseudoBlockArray purposefully adding BlockSlice to retain the information about which block a range was coming from. I don't exactly recall why this was necessary, but I suspect it was for BlockBandedMatrices.jl where we needed to recognise that view(A, Block(K,J)) was banded. That said, with the proposed redesign this will return a BandedMatrix which is even nicer. And probably when I designed the code I thought it wasn't allowed to return something other than a SubArray, but my view has changed as of an hour ago.
We have two different versions of getting a block without copying:
getblock(A, k::Int...)
andview(A, ::Block...)
. I propose deprecatinggetblock
and having the canonical version the latter. Note this would meanview
does not (always) return aSubArray
, but this is fine:Note this might break some code: I recall for
PseudoBlockArray
purposefully addingBlockSlice
to retain the information about which block a range was coming from. I don't exactly recall why this was necessary, but I suspect it was for BlockBandedMatrices.jl where we needed to recognise thatview(A, Block(K,J))
was banded. That said, with the proposed redesign this will return aBandedMatrix
which is even nicer. And probably when I designed the code I thought it wasn't allowed to return something other than aSubArray
, but my view has changed as of an hour ago.Cf JuliaLang/julia#38536 JuliaLang/julia#38536
The text was updated successfully, but these errors were encountered: