@@ -2,15 +2,15 @@ using InfiniteLinearAlgebra, BlockBandedMatrices, BlockArrays, BandedMatrices, I
2
2
MatrixFactorizations, ArrayLayouts, LinearAlgebra, Random, LazyBandedMatrices, StaticArrays
3
3
import InfiniteLinearAlgebra: qltail, toeptail, tailiterate , tailiterate!, tail_de, ql_X!,
4
4
InfToeplitz, PertToeplitz, TriToeplitz, InfBandedMatrix, InfBandCartesianIndices,
5
- rightasymptotics, QLHessenberg, ConstRows, PertConstRows,
5
+ rightasymptotics, QLHessenberg, ConstRows, PertConstRows,
6
6
BandedToeplitzLayout, PertToeplitzLayout, TridiagonalToeplitzLayout, BidiagonalToeplitzLayout
7
7
import Base: BroadcastStyle
8
8
import BlockArrays: _BlockArray
9
9
import BlockBandedMatrices: isblockbanded, _BlockBandedMatrix
10
10
import MatrixFactorizations: QLPackedQ
11
11
import BandedMatrices: bandeddata, _BandedMatrix, BandedStyle
12
12
import LazyArrays: colsupport, ApplyStyle, MemoryLayout, ApplyLayout, LazyArrayStyle, arguments
13
- import InfiniteArrays: OneToInf, oneto
13
+ import InfiniteArrays: OneToInf, oneto, RealInfinity
14
14
import LazyBandedMatrices: BroadcastBandedBlockBandedLayout, BroadcastBandedLayout, LazyBandedLayout
15
15
16
16
@@ -39,7 +39,7 @@ import LazyBandedMatrices: BroadcastBandedBlockBandedLayout, BroadcastBandedLayo
39
39
@test B* A* x isa Vcat
40
40
@test (B* A* x)[1 : 10 ] == [0 ; 10 ; 14 ; 12 ; zeros (6 )]
41
41
42
- @test _BandedMatrix ((1 : ∞)' , ∞, - 1 , 1 ) isa BandedMatrix
42
+ @test _BandedMatrix ((1 : ∞)' , ∞, - 1 , 1 ) isa BandedMatrix
43
43
end
44
44
45
45
@testset " ∞-Toeplitz" begin
@@ -103,7 +103,7 @@ import LazyBandedMatrices: BroadcastBandedBlockBandedLayout, BroadcastBandedLayo
103
103
@test (A + 2 I)[1 : 10 ,1 : 10 ] == (2 I + A)[1 : 10 ,1 : 10 ] == A[1 : 10 ,1 : 10 ] + 2 I
104
104
@test (Adjoint (A) + 2 I)[1 : 10 ,1 : 10 ] == (2 I + Adjoint (A))[1 : 10 ,1 : 10 ] == Adjoint (A)[1 : 10 ,1 : 10 ] + 2 I
105
105
end
106
-
106
+
107
107
108
108
@testset " InfBanded" begin
109
109
A = _BandedMatrix (Fill (2 ,4 ,∞),ℵ₀,2 ,1 )
138
138
@test blockaxes (b,1 ) ≡ Block .(OneToInf ())
139
139
@test b[Block (5 )] == [1 ,2 ]
140
140
@test length (axes (b,1 )) ≡ ℵ₀
141
- @test last (axes (b,1 )) ≡ ∞
141
+ @test last (axes (b,1 )) ≡ RealInfinity ()
142
142
@test Base. BroadcastStyle (typeof (b)) isa LazyArrayStyle{1 }
143
143
end
144
144
193
193
194
194
@testset " triangle recurrences" begin
195
195
@testset " n and k" begin
196
- n = mortar (Fill .(oneto (∞),oneto (∞)))
197
- k = mortar (Base. OneTo .(oneto (∞)))
196
+ n = mortar (Fill .(oneto (∞),oneto (∞)));
197
+ k = mortar (Base. OneTo .(oneto (∞)));
198
198
199
199
@test n[Block (5 )] ≡ layout_getindex (n, Block (5 )) ≡ view (n,Block (5 )) ≡ Fill (5 ,5 )
200
200
@test k[Block (5 )] ≡ layout_getindex (k, Block (5 )) ≡ view (k,Block (5 )) ≡ Base. OneTo (5 )
217
217
@test @allocated (axes (v)) ≤ 40
218
218
@test copyto! (dest, v) == v
219
219
220
+ @testset " stack overflow" begin
221
+ i = Base. to_indices (k, (Block .(2 : ∞),))[1 ]. indices;
222
+ last (i)
223
+ end
224
+
220
225
v = view (k,Block .(2 : ∞))
221
226
@test Base. BroadcastStyle (typeof (v)) isa LazyArrayStyle{1 }
222
227
@test v[Block (1 )] == 1 : 2
254
259
n = mortar (Fill .(oneto (∞),oneto (∞)))
255
260
k = mortar (Base. OneTo .(oneto (∞)))
256
261
Dy = BlockBandedMatrices. _BandedBlockBandedMatrix ((k .+ (b+ c))' , axes (k,1 ), (- 1 ,1 ), (- 1 ,1 ))
257
- N = 100 ;
262
+ N = 100 ;
258
263
@test Dy[Block .(1 : N), Block .(1 : N)] == BlockBandedMatrices. _BandedBlockBandedMatrix ((k .+ (b+ c))[Block .(1 : N)]' , axes (k,1 )[Block .(1 : N)], (- 1 ,1 ), (- 1 ,1 ))
259
264
end
260
265
end
0 commit comments