@@ -2,6 +2,7 @@ using InfiniteLinearAlgebra, ArrayLayouts, InfiniteArrays, BandedMatrices, FillA
22import BandedMatrices: _BandedMatrix, bandeddata
33using InfiniteLinearAlgebra: InfToeplitz, ConstRows, BandedToeplitzLayout, TridiagonalToeplitzLayout, BidiagonalToeplitzLayout, PertToeplitz, PertToeplitzLayout
44using Base: oneto
5+ using LazyArrays: simplifiable
56
67@testset " ∞-banded" begin
78 @testset " Diagonal and BandedMatrix" begin
@@ -55,6 +56,9 @@ using Base: oneto
5556 @test A * [1 ; 2 ; Zeros (∞)] isa Vcat
5657 @test A * [1 ; 2 ; Zeros (∞)] == [A[1 : 5 ,1 : 2 ] * [1 ,2 ]; Zeros (∞)]
5758
59+ @test A * Vcat ([1 2 ; 3 4 ], Zeros (∞,2 )) isa ApplyMatrix{ComplexF64,typeof (Base. setindex)}
60+ @test simplifiable (* , A, Vcat ([1 2 ; 3 4 ], Zeros (∞,2 ))) == Val (true )
61+
5862 @test MemoryLayout (Tridiagonal (Fill (1 ,∞), Fill (2 ,∞), Fill (3 ,∞))) isa TridiagonalToeplitzLayout
5963 @test MemoryLayout (Bidiagonal (Fill (1 ,∞), Fill (2 ,∞), :U )) isa BidiagonalToeplitzLayout
6064 @test MemoryLayout (SymTridiagonal (Fill (1 ,∞), Fill (2 ,∞))) isa TridiagonalToeplitzLayout
@@ -87,6 +91,18 @@ using Base: oneto
8791 @test (B* B)[1 : 10 ,1 : 10 ] ≈ B[1 : 10 ,1 : 14 ]B[1 : 14 ,1 : 10 ]
8892 @test (A* B)[1 : 10 ,1 : 10 ] ≈ A[1 : 10 ,1 : 14 ]B[1 : 14 ,1 : 10 ]
8993 @test (B* A)[1 : 10 ,1 : 10 ] ≈ B[1 : 10 ,1 : 14 ]A[1 : 14 ,1 : 10 ]
94+ @test simplifiable (* , B, B) == Val (true )
95+ @test length ((A* B* B). args) == 2
96+ @test length ((B* B* A). args) == 2
97+ end
98+
99+ @testset " Toep * Diag" begin
100+ A = BandedMatrix (1 => Fill (2im ,∞), 2 => Fill (- 1 ,∞), 3 => Fill (2 ,∞), - 2 => Fill (- 4 ,∞), - 3 => Fill (- 2im ,∞))
101+ D = Diagonal (1 : ∞)
102+ @test D* A isa BroadcastMatrix
103+ @test A* D isa BroadcastMatrix
104+ @test simplifiable (* , D, A) == Val (true )
105+ @test simplifiable (* , A, D) == Val (true )
90106 end
91107 end
92108
0 commit comments