@@ -84,6 +84,11 @@ const InfBandCartesianIndices = InfiniteArraysBandedMatricesExt.InfBandCartesian
8484 S = SymTridiagonal (Fill (1 ,∞), Fill (2 ,∞))
8585 @test (S + 2 I)[1 : 10 ,1 : 10 ] == (2 I + S)[1 : 10 ,1 : 10 ] == S[1 : 10 ,1 : 10 ] + 2 I
8686 @test BandedMatrix (S, (2 ,3 ))[1 : 10 ,1 : 10 ] == S[1 : 10 ,1 : 10 ]
87+
88+ B = Bidiagonal (Fill (1 ,∞), Fill (2 ,∞), :U )
89+ @test (B* B)[1 : 10 ,1 : 10 ] == B[1 : 10 ,1 : 11 ] * B[1 : 11 ,1 : 10 ]
90+
91+ @test (B \ [1 : 10 ; zeros (∞)])[1 : 10 ] == B[1 : 10 ,1 : 10 ] \ (1 : 10 )
8792 end
8893
8994 @testset " constant data" begin
@@ -202,14 +207,17 @@ const InfBandCartesianIndices = InfiniteArraysBandedMatricesExt.InfBandCartesian
202207
203208 @testset " SubArray broadcasting" begin
204209 A = BandedMatrix (2 => 1 : ∞)
205- @test exp .(A[1 : 2 : ∞,1 : 2 : ∞])[1 : 10 ,1 : 10 ] ≈ exp .(A[1 : 2 : 20 ,1 : 2 : 20 ])
210+ @test exp .(A[1 : 2 : ∞,1 : 2 : ∞])[1 : 10 ,1 : 10 ] ≈ exp .(A)[ 1 : 2 : 20 , 1 : 2 : 20 ] ≈ exp .(A [1 : 2 : 20 ,1 : 2 : 20 ])
206211 @test A[band (2 )][1 : 5 ] == 1 : 5
207212 @test _BandedMatrix ((1 : ∞)' , ∞, - 1 ,1 )[band (1 )][1 : 5 ] == 2 : 6
208213 @test exp .(view (A,band (2 )))[1 : 10 ] ≈ exp .(1 : 10 )
209214
210215 @test BandedMatrices. banded_similar (Int, (∞,5 ), (1 ,1 )) isa BandedMatrix
211216 @test BandedMatrices. banded_similar (Int, (5 ,∞), (1 ,1 )) isa Adjoint{<: Any ,<: BandedMatrix }
212217
218+ @test (A+ A)[2 : ∞,3 : ∞] isa SubArray
219+ @test (A* A)[2 : ∞,3 : ∞] isa SubArray
220+
213221 A = BandedMatrix {Int} ((2 => 1 : ∞,), (∞,∞), (0 ,2 ))
214222 @test eltype (A) == Int
215223 @test bandwidths (A) == (0 ,2 )
0 commit comments