Skip to content

Commit 84adbc7

Browse files
committed
Fix HermitianLayout
1 parent 8335f99 commit 84adbc7

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1515
[compat]
1616
ArrayLayouts = "0.8.2"
1717
BandedMatrices = "0.16.8, 0.17"
18-
BlockArrays = "0.16.6"
18+
BlockArrays = "0.16.14"
1919
FillArrays = "0.13"
2020
MatrixFactorizations = "0.8.5, 0.9"
2121
julia = "1.6"

src/AbstractBlockBandedMatrix.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ conjlayout(::Type{T}, ::BlockBandedColumns{Lay}) where {T<:Complex,Lay} = BlockB
4040
conjlayout(::Type{T}, ::BlockBandedRows{Lay}) where {T<:Complex,Lay} = BlockBandedRows{typeof(conjlayout(T,Lay))}()
4141

4242
symmetriclayout(::AbstractBandedBlockBandedLayout) = BandedBlockBandedLayout()
43-
hermitianlayout(::AbstractBandedBlockBandedLayout) = BandedBlockBandedLayout()
43+
hermitianlayout(_, ::AbstractBandedBlockBandedLayout) = BandedBlockBandedLayout()
4444

4545
function blockbandwidths(S::HermOrSym)
4646
l, u = blockbandwidths(parent(S))

test/test_bandedblockbanded.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,11 +524,19 @@ import ArrayLayouts: RangeCumsum
524524
cols = rows = 1:N
525525
data = reshape(collect(1:+μ+1)*(l+u+1)*sum(cols)), ((λ + μ + 1) * (l + u + 1), sum(cols)))
526526
A = _BandedBlockBandedMatrix(data, rows, cols, (l, u), (λ, μ))
527+
528+
@test blockbandwidths(Hermitian(A)) == blockbandwidths(Symmetric(A)) == (1,1)
529+
@test blockbandwidths(Hermitian(A,:L)) == blockbandwidths(Symmetric(A,:L)) == (2,2)
530+
@test subblockbandwidths(Hermitian(A)) == subblockbandwidths(Symmetric(A)) == (2,2)
531+
@test subblockbandwidths(Hermitian(A,:L)) == subblockbandwidths(Symmetric(A,:L)) == (2,2)
527532

528533
@test BandedBlockBandedMatrix(Symmetric(A)) == Symmetric(Matrix(A))
529534
@test BandedBlockBandedMatrix(Symmetric(A,:L)) == Symmetric(Matrix(A),:L)
530535
@test BandedBlockBandedMatrix(Hermitian(A)) == Hermitian(Matrix(A))
531536
@test BandedBlockBandedMatrix(Hermitian(A,:L)) == Hermitian(Matrix(A),:L)
537+
538+
@test Symmetric(A)[Block.(1:3),Block.(1:3)] isa BandedBlockBandedMatrix
539+
@test Hermitian(A)[Block.(1:3),Block.(1:3)] isa BandedBlockBandedMatrix
532540
end
533541
end
534542

0 commit comments

Comments
 (0)