@@ -516,6 +516,28 @@ import ArrayLayouts: RangeCumsum
516
516
@test convert (AbstractArray{Float64}, A) == convert (AbstractMatrix{Float64}, A) == A
517
517
@test convert (AbstractArray{Int}, A) ≡ convert (AbstractMatrix{Int}, A) ≡ A
518
518
end
519
+
520
+ @testset " Symmetric" begin
521
+ l, u = 2 , 1
522
+ λ, μ = 2 , 1
523
+ N = M = 4
524
+ cols = rows = 1 : N
525
+ data = reshape (collect (1 : (λ+ μ+ 1 )* (l+ u+ 1 )* sum (cols)), ((λ + μ + 1 ) * (l + u + 1 ), sum (cols)))
526
+ 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 )
532
+
533
+ @test BandedBlockBandedMatrix (Symmetric (A)) == Symmetric (Matrix (A))
534
+ @test BandedBlockBandedMatrix (Symmetric (A,:L )) == Symmetric (Matrix (A),:L )
535
+ @test BandedBlockBandedMatrix (Hermitian (A)) == Hermitian (Matrix (A))
536
+ @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
540
+ end
519
541
end
520
542
521
543
if false # turned off since tests have check-bounds=yes
0 commit comments