Skip to content

Commit 45bc774

Browse files
committed
Realised Hermite and Stieltjes tests weren't being run... need to come back later and fix bugs
1 parent 45b7d31 commit 45bc774

File tree

5 files changed

+17
-20
lines changed

5 files changed

+17
-20
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ FastGaussQuadrature = "0.4.3"
3636
FastTransforms = "0.11, 0.12"
3737
FillArrays = "0.11"
3838
InfiniteArrays = "0.10"
39-
InfiniteLinearAlgebra = "0.5.1"
39+
InfiniteLinearAlgebra = "0.5.2"
4040
IntervalSets = "0.5"
4141
LazyArrays = "0.20.6"
4242
LazyBandedMatrices = "0.5"

src/hermite.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ axes(::Hermite{T}) where T = (Inclusion(ℝ), oneto(∞))
1818
# 1/2 * H_{n+1} + n H_{n-1} = x H_n
1919
# x*[H_0 H_1 H_2 …] = [H_0 H_1 H_2 …] * [0 1; 1/2 0 2; 1/2 0 3; …]
2020
jacobimatrix(H::Hermite{T}) where T = Tridiagonal(Fill(one(T)/2,∞), Zeros{T}(∞), one(T):∞)
21+
recurrencecoefficients(H::Hermite{T}) where T = Fill{T}(2,∞), Zeros{T}(∞), zero(T):2:
2122

2223
@simplify function *(Ac::QuasiAdjoint{<:Any,<:Hermite}, B::WeightedBasis{<:Any,<:HermiteWeight,<:Hermite})
2324
T = promote_type(eltype(Ac), eltype(B))

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ include("test_chebyshev.jl")
3131
include("test_legendre.jl")
3232
include("test_ultraspherical.jl")
3333
include("test_jacobi.jl")
34+
include("test_hermite.jl")
3435
include("test_fourier.jl")
3536
include("test_odes.jl")
3637
include("test_normalized.jl")
3738
include("test_lanczos.jl")
39+
include("test_stieltjes.jl")
3840

3941
@testset "Auto-diff" begin
4042
U = Ultraspherical(1)

test/test_hermite.jl

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
using ClassicalOrthogonalPolynomials, ContinuumArrays, DomainSets, FillArrays, Test
2-
import ClassicalOrthogonalPolynomials: jacobimatrix
2+
import ClassicalOrthogonalPolynomials: jacobimatrix, oneto
33

44
@testset "Hermite" begin
55
H = Hermite()
66
@test axes(H) == (Inclusion(ℝ), oneto(∞))
77
x = axes(H,1)
8-
X = jacobimatrix(H)
9-
10-
w = HermiteWeight()
11-
wH = w.*H
12-
M = H'* ( w.*H)
13-
S = Diagonal(M.diag .^ (-1/2))
14-
Si = Diagonal(M.diag .^ (1/2))
15-
J = Si*X*S
8+
@test H[0.1,1:4] [1,2*0.1,4*0.1^2-2,8*0.1^3-12*0.1]
169

17-
(J - im*Eye(∞)) \ [1;zeros(∞)]
10+
X = jacobimatrix(H)
11+
@test 0.1 * H[0.1,1:10]' H[0.1,1:11]'*X[1:11,1:10]
1812

19-
@test H[0.1,1] === 1.0 # equivalent to H_0(0.1) == 1.0
2013
D = Derivative(x)
21-
22-
h = 0.000001
23-
@test (D*H)[0.1,1:5] (H[0.1+h,1:5] - H[0.1,1:5])/h atol=100h
14+
@test (D*H)[0.1,1:4] [0,2,8*0.1,24*0.1^2-12]
2415
end

test/test_stieltjes.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,23 @@ import ClassicalOrthogonalPolynomials: Hilbert, StieltjesPoint
1010
@test S isa StieltjesPoint{ComplexF64,Float64,ChebyshevInterval{Float64}}
1111
f = wT * [[1,2,3]; zeros(∞)];
1212
J = T \ (x .* T)
13-
@test π*((z*I-J) \ f.args[2])[1,1] (S*f)[1]
13+
# TODO: fix LazyBandedMatrices.copy(M::Mul{Broadcast...}) to call simplify
14+
@test_broken π*((z*I-J) \ f.args[2])[1,1] (S*f)[1]
15+
@test π*((z*I-J) \ f.args[2])[1,1] (S*f.args[1]*f.args[2])[1]
1416

1517
x = Inclusion(0..1)
1618
y = 2x .- 1
1719
wT2 = wT[y,:]
1820
S = inv.(z .- x')
1921
f = wT2 * [[1,2,3]; zeros(∞)];
2022

21-
@test/2*(((z-1/2)*I - J/2) \ f.args[2]))[1] (S*f)[1]
23+
# TODO: fix LazyArrays ambiguity
24+
@test_broken/2*(((z-1/2)*I - J/2) \ f.args[2]))[1] (S*f.args[1]*f.args[2])[1]
2225
end
2326

2427
@testset "Hilbert" begin
25-
wT = ChebyshevWeight() .* Chebyshev()
26-
wU = UltrasphericalWeight(1) .* Ultraspherical(1)
28+
wT = ChebyshevTWeight() .* ChebyshevT()
29+
wU = ChebyshevUWeight() .* ChebyshevU()
2730
x = axes(wT,1)
2831
H = inv.(x .- x')
2932
@test H isa Hilbert{Float64,ChebyshevInterval{Float64}}
@@ -43,7 +46,7 @@ end
4346
wT2 = wT[y,:]
4447
wU2 = wU[y,:]
4548
@test (Ultraspherical(1)[y,:]\(H*wT2))[1:10,1:10] == diagm(1 => fill(-π,9))
46-
@test (Chebyshev()[y,:]\(H*wU2))[1:10,1:10] == diagm(-1 => fill(1.0π,9))
49+
@test_broken (Chebyshev()[y,:]\(H*wU2))[1:10,1:10] == diagm(-1 => fill(1.0π,9))
4750
end
4851

4952
@testset "Log kernel" begin

0 commit comments

Comments
 (0)