Skip to content

Commit f94e289

Browse files
authored
Tests for type-inference in kronecker operator indexing (#288)
* Tests for type-inference in kronecker operator indexing * Import BlockArrays * Import BlockBandedMatrices
1 parent 53068cb commit f94e289

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
2727
ApproxFunOrthogonalPolynomialsStaticExt = "Static"
2828

2929
[compat]
30-
ApproxFunBase = "0.8.39, 0.9"
30+
ApproxFunBase = "0.8.47, 0.9.2"
3131
ApproxFunBaseTest = "0.1"
3232
Aqua = "0.6"
3333
BandedMatrices = "0.16, 0.17"

test/JacobiTest.jl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ using ApproxFunBaseTest: testbandedbelowoperator, testbandedoperator, testspace,
1111
testfunctional
1212
using ApproxFunOrthogonalPolynomials: jacobip
1313
using BandedMatrices
14+
using BlockArrays
15+
using BlockBandedMatrices
1416
using StaticArrays: SVector
1517
using Static
1618
using HalfIntegers
@@ -841,12 +843,17 @@ include("testutils.jl")
841843
testspaces(d1, d2, r1, r2)
842844
end
843845

844-
d1, r1 = Legendre(), Jacobi(2,2)
845-
d2, r2 = Chebyshev(), Chebyshev()
846-
K = (Operator(I, d1) Operator(I, d2)) (r1 r2)
847-
M = K[1:20, 1:20]
848-
for ind in CartesianIndices(M)
849-
@test K[ind] M[ind]
846+
@testset "Indexing" begin
847+
d1, r1 = Legendre(), Jacobi(2,2)
848+
d2, r2 = Chebyshev(), Chebyshev()
849+
K = (Operator(I, d1) Operator(I, d2)) (r1 r2)
850+
M = @inferred K[1:20, 1:20]
851+
for ind in CartesianIndices(M)
852+
@test K[ind] M[ind]
853+
end
854+
Kv = view(K, Block(1):Block(1), Block(1):Block(1))
855+
Y = @inferred BandedBlockBandedMatrix(Kv)
856+
@test Y == reshape([K[1,1]], 1, 1)
850857
end
851858
end
852859
end

0 commit comments

Comments
 (0)