@@ -2,6 +2,7 @@ using InfiniteLinearAlgebra, ArrayLayouts, InfiniteArrays, BandedMatrices, FillA
2
2
import BandedMatrices: _BandedMatrix, bandeddata
3
3
using InfiniteLinearAlgebra: InfToeplitz, ConstRows, BandedToeplitzLayout, TridiagonalToeplitzLayout, BidiagonalToeplitzLayout, PertToeplitz, PertToeplitzLayout
4
4
using Base: oneto
5
+ using LazyArrays: simplifiable
5
6
6
7
@testset " ∞-banded" begin
7
8
@testset " Diagonal and BandedMatrix" begin
@@ -55,6 +56,9 @@ using Base: oneto
55
56
@test A * [1 ; 2 ; Zeros (∞)] isa Vcat
56
57
@test A * [1 ; 2 ; Zeros (∞)] == [A[1 : 5 ,1 : 2 ] * [1 ,2 ]; Zeros (∞)]
57
58
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
+
58
62
@test MemoryLayout (Tridiagonal (Fill (1 ,∞), Fill (2 ,∞), Fill (3 ,∞))) isa TridiagonalToeplitzLayout
59
63
@test MemoryLayout (Bidiagonal (Fill (1 ,∞), Fill (2 ,∞), :U )) isa BidiagonalToeplitzLayout
60
64
@test MemoryLayout (SymTridiagonal (Fill (1 ,∞), Fill (2 ,∞))) isa TridiagonalToeplitzLayout
@@ -87,6 +91,18 @@ using Base: oneto
87
91
@test (B* B)[1 : 10 ,1 : 10 ] ≈ B[1 : 10 ,1 : 14 ]B[1 : 14 ,1 : 10 ]
88
92
@test (A* B)[1 : 10 ,1 : 10 ] ≈ A[1 : 10 ,1 : 14 ]B[1 : 14 ,1 : 10 ]
89
93
@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 )
90
106
end
91
107
end
92
108
0 commit comments