Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 = "BlockBandedMatrices"
uuid = "ffab5731-97b5-5995-9138-79e8c1846df0"
version = "0.13.6"
version = "0.13.7"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
8 changes: 4 additions & 4 deletions src/AbstractBlockBandedMatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 1 addition & 2 deletions src/BandedBlockBandedMatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/BlockSkylineMatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions test/test_adjtransblockbanded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)])
Expand All @@ -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)])
Expand Down
Loading