Skip to content

Commit 0f1b2d3

Browse files
committed
add tests for type declaration
1 parent 2606616 commit 0f1b2d3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/SemiclassicalOrthogonalPolynomials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ function semijacobi_ldiv(Q::SemiclassicalJacobi, P::SemiclassicalJacobi)
293293
Δa = Q.a-P.a
294294
Δb = Q.b-P.b
295295
Δc = Q.c-P.c
296-
if isinteger(Δa) && isinteger(Δb) && isinteger(Δc) # (Δa,Δb,Δc) are integers -> use QR/Cholesky
296+
if isinteger(Δa) && isinteger(Δb) && isinteger(Δc) # (Δa,Δb,Δc) are integers -> use QR/Cholesky iteratively
297297
if ((isone(Δa)||isone(Δa/2)) && iszero(Δb) && iszero(Δc)) || (iszero(Δa) && (isone(Δb)||isone(Δb/2)) && iszero(Δc)) || (iszero(Δa) && iszero(Δb) && (isone(Δc)||isone(Δc/2)))
298298
M = semijacobi_ldiv_direct(Q, P)
299299
elseif Δa > 0 # iterative modification by 1

test/runtests.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ end
5959
@test w == jacobiexpansion(w)
6060
end
6161

62+
@testset "Evaluations and Type declaration" begin
63+
@test SemiclassicalJacobi(1.1,0,0,4)[0.2, 1] SemiclassicalJacobi{Float64}(1.1,0,0,4)[0.2, 1]
64+
@test SemiclassicalJacobi(1.013,0,0,4)[0.1993, 3] SemiclassicalJacobi{Float64}(1.013,0,0,4)[0.1993, 3]
65+
@test SemiclassicalJacobi(1.013,2,2,2.3)[0.7, 4] SemiclassicalJacobi{Float64}(1.013,2,2,2.3)[0.7, 4]
66+
end
67+
6268
@testset "Half-range Chebyshev" begin
6369
@testset "T and W" begin
6470
T = SemiclassicalJacobi(2, -1/2, 0, -1/2)

0 commit comments

Comments
 (0)