Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "BlockArrays"
uuid = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
version = "1.6.2"
version = "1.6.3"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
2 changes: 2 additions & 0 deletions src/blockindices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ BlockIndexRange(block::Block{N}, inds::Vararg{AbstractUnitRange{<:Integer},N}) w

block(R::BlockIndexRange) = R.block

copy(R::BlockIndexRange) = BlockIndexRange(R.block, copy.(R.indices))

getindex(::Block{0}) = BlockIndex()
getindex(B::Block{N}, inds::Vararg{Integer,N}) where N = BlockIndex(B,inds)
getindex(B::Block{N}, inds::Vararg{AbstractUnitRange{<:Integer},N}) where N = BlockIndexRange(B,inds)
Expand Down
6 changes: 6 additions & 0 deletions test/test_blockarrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,12 @@ end
@test A[Block(1)[1], Block(1)[1:1]] == BlockArray(A)[Block(1)[1], Block(1)[1:1]] == A[1,1:1]
end

@testset "BlockIndexRange blocks" begin
a = mortar([Block(1)[1:2], Block(3)[2:3]])
@test a[Block(1)] === Block(1)[1:2]
@test a[Block(2)] === Block(3)[2:3]
end

@testset "permutedims" begin
for a in (BlockArray(randn(3), [1,2]), BlockedArray(randn(3), [1,2]))
@test permutedims(a) == permutedims(Vector(a))
Expand Down
1 change: 1 addition & 0 deletions test/test_blockindices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ import BlockArrays: BlockIndex, BlockIndexRange, BlockSlice
@test BlockIndex(UInt(2),(2,)) === BlockIndex((UInt(2),),(2,))
@test BlockIndex(Block(2),2) === BlockIndex(Block(2),(2,))
@test BlockIndex(Block(2),UInt(2)) === BlockIndex(Block(2),(UInt(2),))
@test copy(Block(1)[1:2]) === BlockIndexRange(Block(1),1:2)
end

@testset "BlockRange" begin
Expand Down
Loading