11using ArrayLayouts, BlockBandedMatrices, BandedMatrices, BlockArrays, LinearAlgebra, Test
2- import BlockBandedMatrices: AbstractBandedBlockBandedMatrix, block, blockindex
3- import BandedMatrices: bandwidths, AbstractBandedMatrix, BandedStyle, bandeddata, BandedColumns
2+ import BlockBandedMatrices: AbstractBandedBlockBandedMatrix, block, blockindex, blockcolsupport, blockrowsupport
3+ import BandedMatrices: bandwidths, AbstractBandedMatrix, BandedStyle, bandeddata, BandedColumns, _BandedMatrix
44
55struct MyBandedBlockBandedMatrix <: AbstractBandedBlockBandedMatrix{Float64}
66 A:: BlockMatrix{Float64}
124124 @test blockbandwidths (D[Block .(1 : 2 ),Block .(2 : 3 )]) == (1 ,- 1 )
125125 @test subblockbandwidths (D[Block .(1 : 2 ),Block .(2 : 3 )]) == (0 ,0 )
126126 end
127+
128+ @testset " Block-BandedMatrix" begin
129+ a = blockedrange (1 : 5 )
130+ B = _BandedMatrix (PseudoBlockArray (randn (5 ,length (a)),(Base. OneTo (5 ),a)), a, 3 , 1 )
131+ @test blockcolsupport (B,1 ) == Block .(1 : 3 )
132+ @test blockcolsupport (B,3 ) == Block .(2 : 4 )
133+ @test blockrowsupport (B,1 ) == Block .(1 : 2 )
134+ @test blockrowsupport (B,4 ) == Block .(3 : 5 )
135+
136+ Q = Eye ((a,))[:,Block (2 )]
137+ @test Q isa BandedMatrix
138+ @test blockcolsupport (Q,1 ) == Block .(2 : 2 )
139+
140+ Q = Eye ((a,))[Block (2 ),:]
141+ @test Q isa BandedMatrix
142+ @test blockrowsupport (Q,1 ) == Block .(2 : 2 )
143+ end
127144end
0 commit comments