@@ -36,6 +36,44 @@ import LazyBandedMatrices: BroadcastBandedBlockBandedLayout, BroadcastBandedLayo
36
36
37
37
@test B* A* x isa Vcat
38
38
@test (B* A* x)[1 : 10 ] == [0 ; 10 ; 14 ; 12 ; zeros (6 )]
39
+
40
+ @test _BandedMatrix ((1 : ∞)' , ∞, - 1 , 1 ) isa BandedMatrix
41
+
42
+ @testset " ∞-Toeplitz" begin
43
+ A = BandedMatrix (1 => Fill (2im ,∞), 2 => Fill (- 1 ,∞), 3 => Fill (2 ,∞), - 2 => Fill (- 4 ,∞), - 3 => Fill (- 2im ,∞))
44
+ @test A isa InfToeplitz
45
+ @test MemoryLayout (typeof (A. data)) == ConstRows ()
46
+ @test MemoryLayout (typeof (A)) == BandedToeplitzLayout ()
47
+ V = view (A,:,3 : ∞)
48
+ @test MemoryLayout (typeof (bandeddata (V))) == ConstRows ()
49
+ @test MemoryLayout (typeof (V)) == BandedToeplitzLayout ()
50
+ @test BandedMatrix (V) isa InfToeplitz
51
+ @test A[:,3 : end ] isa InfToeplitz
52
+
53
+ @test (A + 2 I)[1 : 10 ,1 : 10 ] == (2 I + A)[1 : 10 ,1 : 10 ] == A[1 : 10 ,1 : 10 ] + 2 I
54
+ end
55
+
56
+ @testset " Pert-Toeplitz" begin
57
+ A = BandedMatrix (- 2 => Vcat (Float64[], Fill (1 / 4 ,∞)), 0 => Vcat ([1.0 + im,2 ,3 ],Fill (0 ,∞)), 1 => Vcat (Float64[], Fill (1 ,∞)))
58
+ @test A isa PertToeplitz
59
+ @test MemoryLayout (typeof (A)) == PertToeplitzLayout ()
60
+ V = view (A,2 : ∞,2 : ∞)
61
+ @test MemoryLayout (typeof (V)) == PertToeplitzLayout ()
62
+ @test BandedMatrix (V) isa PertToeplitz
63
+ @test A[2 : ∞,2 : ∞] isa PertToeplitz
64
+
65
+ @test (A + 2 I)[1 : 10 ,1 : 10 ] == (2 I + A)[1 : 10 ,1 : 10 ] == A[1 : 10 ,1 : 10 ] + 2 I
66
+
67
+
68
+ @testset " InfBanded" begin
69
+ A = _BandedMatrix (Fill (2 ,4 ,∞),ℵ₀,2 ,1 )
70
+ B = _BandedMatrix (Fill (3 ,2 ,∞),ℵ₀,- 1 ,2 )
71
+ @test mul (A,A) isa PertToeplitz
72
+ @test A* A isa PertToeplitz
73
+ @test (A* A)[1 : 20 ,1 : 20 ] == A[1 : 20 ,1 : 23 ]* A[1 : 23 ,1 : 20 ]
74
+ @test (A* B)[1 : 20 ,1 : 20 ] == A[1 : 20 ,1 : 23 ]* B[1 : 23 ,1 : 20 ]
75
+ end
76
+ end
39
77
end
40
78
41
79
@testset " ∞-block arrays" begin
184
222
end
185
223
end
186
224
187
- @testset " ∞-Toeplitz and Pert-Toeplitz" begin
188
- A = BandedMatrix (1 => Fill (2im ,∞), 2 => Fill (- 1 ,∞), 3 => Fill (2 ,∞), - 2 => Fill (- 4 ,∞), - 3 => Fill (- 2im ,∞))
189
- @test A isa InfToeplitz
190
- @test MemoryLayout (typeof (A. data)) == ConstRows ()
191
- @test MemoryLayout (typeof (A)) == BandedToeplitzLayout ()
192
- V = view (A,:,3 : ∞)
193
- @test MemoryLayout (typeof (bandeddata (V))) == ConstRows ()
194
- @test MemoryLayout (typeof (V)) == BandedToeplitzLayout ()
195
-
196
- @test BandedMatrix (V) isa InfToeplitz
197
- @test A[:,3 : end ] isa InfToeplitz
198
-
199
- A = BandedMatrix (- 2 => Vcat (Float64[], Fill (1 / 4 ,∞)), 0 => Vcat ([1.0 + im,2 ,3 ],Fill (0 ,∞)), 1 => Vcat (Float64[], Fill (1 ,∞)))
200
- @test A isa PertToeplitz
201
- @test MemoryLayout (typeof (A)) == PertToeplitzLayout ()
202
- V = view (A,2 : ∞,2 : ∞)
203
- @test MemoryLayout (typeof (V)) == PertToeplitzLayout ()
204
- @test BandedMatrix (V) isa PertToeplitz
205
- @test A[2 : ∞,2 : ∞] isa PertToeplitz
206
-
207
- @testset " InfBanded" begin
208
- A = _BandedMatrix (Fill (2 ,4 ,∞),ℵ₀,2 ,1 )
209
- B = _BandedMatrix (Fill (3 ,2 ,∞),ℵ₀,- 1 ,2 )
210
- @test mul (A,A) isa PertToeplitz
211
- @test A* A isa PertToeplitz
212
- @test (A* A)[1 : 20 ,1 : 20 ] == A[1 : 20 ,1 : 23 ]* A[1 : 23 ,1 : 20 ]
213
- @test (A* B)[1 : 20 ,1 : 20 ] == A[1 : 20 ,1 : 23 ]* B[1 : 23 ,1 : 20 ]
214
- end
215
- end
225
+
216
226
217
227
@testset " Algebra" begin
218
228
@testset " BandedMatrix" begin
0 commit comments