Skip to content

Commit 71b386b

Browse files
committed
Fix some tests
1 parent 179c61c commit 71b386b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/BlockArraysExtensions/BlockArraysExtensions.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ function blockrange(axis::AbstractUnitRange, r::NonBlockedVector)
258258
return Block(1):Block(1)
259259
end
260260

261+
function blockrange(axis::AbstractUnitRange, r::AbstractBlockVector)
262+
# XXX: This may be the inverse permutation.
263+
return Block.(indexin(blocks(r), blocks(axis)))
264+
end
265+
261266
function blockrange(axis::AbstractUnitRange, r)
262267
return error("Slicing not implemented for range of type `$(typeof(r))`.")
263268
end

0 commit comments

Comments
 (0)