|
1 | 1 | using InfiniteLinearAlgebra, LinearAlgebra, BandedMatrices, InfiniteArrays, MatrixFactorizations, LazyArrays, |
2 | 2 | FillArrays, SpecialFunctions, Test, SemiseparableMatrices, LazyBandedMatrices, BlockArrays, BlockBandedMatrices, ArrayLayouts |
3 | | -import LazyArrays: colsupport, rowsupport, MemoryLayout, DenseColumnMajor, TriangularLayout, resizedata!, arguments |
| 3 | +import LazyArrays: colsupport, rowsupport, MemoryLayout, DenseColumnMajor, TriangularLayout, resizedata!, arguments, simplifiable |
4 | 4 | import LazyBandedMatrices: BroadcastBandedLayout, InvDiagTrav, BroadcastBandedBlockBandedLayout |
5 | 5 | import BandedMatrices: _BandedMatrix, _banded_qr!, BandedColumns |
6 | 6 | import InfiniteLinearAlgebra: partialqr!, AdaptiveQRData, AdaptiveQRFactorsBandedLayout, adaptiveqr |
@@ -165,6 +165,29 @@ import SemiseparableMatrices: AlmostBandedLayout, VcatAlmostBandedLayout |
165 | 165 | @test F\b ≈ F\view(b,:) |
166 | 166 | @test_broken F\b ≈ ldiv!(F, view(copy(b),:)) |
167 | 167 | end |
| 168 | + |
| 169 | + @testset "cache/mul" begin |
| 170 | + A = _BandedMatrix(Vcat(Ones(1,∞), (1:∞)', Ones(1,∞)), ℵ₀, 1, 1) |
| 171 | + Q,R = qr(A) |
| 172 | + @test cache(R) ≡ R |
| 173 | + |
| 174 | + @test simplifiable(*, R, A) == Val(false) |
| 175 | + @test simplifiable(*, A, R) == Val(false) |
| 176 | + @test simplifiable(*, parent(R), A) == Val(false) |
| 177 | + @test simplifiable(*, A, parent(R)) == Val(false) |
| 178 | + @test simplifiable(*, inv(R), A) == Val(false) |
| 179 | + @test simplifiable(*, A, inv(R)) == Val(false) |
| 180 | + @test simplifiable(*, inv(R), Q) == Val(false) |
| 181 | + @test simplifiable(*, Q, inv(R)) == Val(false) |
| 182 | + @test simplifiable(*, Symmetric(inv(R)), Q) == Val(false) |
| 183 | + @test simplifiable(*, Q, Symmetric(inv(R))) == Val(false) |
| 184 | + @test (R * A)[1:10,1:10] ≈ R[1:10,1:11] * A[1:11,1:10] |
| 185 | + @test (Q * A)[1:10,1:10] ≈ Q[1:10,1:11] * A[1:11,1:10] |
| 186 | + @test mul(Q, Symmetric(inv(R))) isa ApplyArray # several bugs avoided heree |
| 187 | + @test mul(Symmetric(inv(R)), Q) isa ApplyArray # several bugs avoided heree |
| 188 | + @test (parent(R) * A)[1:10,1:10] ≈ parent(R)[1:10,1:11] * A[1:11,1:10] |
| 189 | + |
| 190 | + end |
168 | 191 | end |
169 | 192 |
|
170 | 193 | @testset "almost-banded" begin |
|
0 commit comments