diff --git a/Project.toml b/Project.toml index 55911dd..b8c8f39 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "BlockBandedMatrices" uuid = "ffab5731-97b5-5995-9138-79e8c1846df0" -version = "0.13.6" +version = "0.13.7" [deps] ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" diff --git a/src/AbstractBlockBandedMatrix.jl b/src/AbstractBlockBandedMatrix.jl index ea5405e..fc98a7f 100644 --- a/src/AbstractBlockBandedMatrix.jl +++ b/src/AbstractBlockBandedMatrix.jl @@ -34,10 +34,10 @@ transposelayout(::BandedBlockBandedRows{Lay}) where Lay = BandedBlockBandedColum transposelayout(::BlockBandedColumns{Lay}) where Lay = BlockBandedRows{Lay}() transposelayout(::BlockBandedRows{Lay}) where Lay = BlockBandedColumns{Lay}() -conjlayout(::Type{T}, ::BandedBlockBandedColumns{Lay}) where {T<:Complex,Lay} = BandedBlockBandedColumns{typeof(conjlayout(T,Lay))}() -conjlayout(::Type{T}, ::BandedBlockBandedRows{Lay}) where {T<:Complex,Lay} = BandedBlockBandedRows{typeof(conjlayout(T,Lay))}() -conjlayout(::Type{T}, ::BlockBandedColumns{Lay}) where {T<:Complex,Lay} = BlockBandedColumns{typeof(conjlayout(T,Lay))}() -conjlayout(::Type{T}, ::BlockBandedRows{Lay}) where {T<:Complex,Lay} = BlockBandedRows{typeof(conjlayout(T,Lay))}() +conjlayout(::Type{T}, ::BandedBlockBandedColumns{Lay}) where {T<:Complex,Lay} = BandedBlockBandedColumns{typeof(conjlayout(T,Lay()))}() +conjlayout(::Type{T}, ::BandedBlockBandedRows{Lay}) where {T<:Complex,Lay} = BandedBlockBandedRows{typeof(conjlayout(T,Lay()))}() +conjlayout(::Type{T}, ::BlockBandedColumns{Lay}) where {T<:Complex,Lay} = BlockBandedColumns{typeof(conjlayout(T,Lay()))}() +conjlayout(::Type{T}, ::BlockBandedRows{Lay}) where {T<:Complex,Lay} = BlockBandedRows{typeof(conjlayout(T,Lay()))}() symmetriclayout(::AbstractBandedBlockBandedLayout) = BandedBlockBandedLayout() hermitianlayout(_, ::AbstractBandedBlockBandedLayout) = BandedBlockBandedLayout() diff --git a/src/BandedBlockBandedMatrix.jl b/src/BandedBlockBandedMatrix.jl index fc367d0..4a6ce40 100644 --- a/src/BandedBlockBandedMatrix.jl +++ b/src/BandedBlockBandedMatrix.jl @@ -335,8 +335,7 @@ zeroblock(A::BandedBlockBandedMatrix, K::Int, J::Int) = # BlockArray(similar(block_array.blocks, Array{T2, N}), copy(block_array.block_sizes)) # end -Base.size(arr::BandedBlockBandedMatrix) = - @inbounds return map(length,axes(arr)) +Base.size(arr::BandedBlockBandedMatrix) = map(length, axes(arr)) @inline function getindex(A::BandedBlockBandedMatrix{T}, i::Int, j::Int) where T diff --git a/src/BlockSkylineMatrix.jl b/src/BlockSkylineMatrix.jl index 633ffa6..ccbc7f2 100644 --- a/src/BlockSkylineMatrix.jl +++ b/src/BlockSkylineMatrix.jl @@ -389,8 +389,7 @@ zeroblock(A::BlockSkylineMatrix, K::Int, J::Int) = # BlockArray(similar(block_array.blocks, Array{T2, N}), copy(block_array.block_sizes)) # end -Base.size(arr::BlockSkylineMatrix) = - @inbounds return map(length,axes(arr)) +Base.size(arr::BlockSkylineMatrix) = map(length, axes(arr)) @inline function getindex(A::BlockSkylineMatrix, i::Int, j::Int) diff --git a/test/test_adjtransblockbanded.jl b/test/test_adjtransblockbanded.jl index bf531b2..36229d7 100644 --- a/test/test_adjtransblockbanded.jl +++ b/test/test_adjtransblockbanded.jl @@ -13,6 +13,11 @@ import BlockBandedMatrices: BandedBlockBandedRowMajor, BandedBlockBandedRows, @test MemoryLayout(A') isa BandedBlockBandedRows @test MemoryLayout(transpose(A)') isa BandedBlockBandedColumns + # the data of an adjoint is conjugated, and the layout of a real matrix is unchanged + @test MemoryLayout(A') isa BandedBlockBandedRows{ConjLayout{ColumnMajor}} + @test MemoryLayout(transpose(A)') isa BandedBlockBandedColumns{ConjLayout{ColumnMajor}} + @test MemoryLayout(BandedBlockBandedMatrix(randn(10,14), 1:4,2:5, (1,2), (2,1))') isa BandedBlockBandedRowMajor + @test A'[Block(1,1)] == A[Block(1,1)]' @test A'[Block(2,3)] == A[Block(3,2)]' @test transpose(A)[Block(1,1)] == transpose(A[Block(1,1)]) @@ -32,6 +37,11 @@ import BlockBandedMatrices: BandedBlockBandedRowMajor, BandedBlockBandedRows, @test MemoryLayout(A') isa BlockBandedRows @test MemoryLayout(transpose(A)') isa BlockBandedColumns + @test MemoryLayout(transpose(A)) isa BlockBandedRows{ColumnMajor} + @test MemoryLayout(A') isa BlockBandedRows{ConjLayout{ColumnMajor}} + @test MemoryLayout(transpose(A)') isa BlockBandedColumns{ConjLayout{ColumnMajor}} + @test MemoryLayout(BlockBandedMatrix(randn(10,14), 1:4,2:5, (1,2))') isa BlockBandedRows{ColumnMajor} + @test A'[Block(1,1)] == A[Block(1,1)]' @test A'[Block(2,3)] == A[Block(3,2)]' @test transpose(A)[Block(1,1)] == transpose(A[Block(1,1)])