Skip to content

Commit cf286a4

Browse files
authored
fix jacobi normalization for complex T (#229)
1 parent 4239507 commit cf286a4

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunOrthogonalPolynomials"
22
uuid = "b70543e2-c0d9-56b8-a290-0d4d6d4de211"
3-
version = "0.6.22"
3+
version = "0.6.23"
44

55
[deps]
66
ApproxFunBase = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"

src/Spaces/Jacobi/Jacobi.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,17 @@ NormalizedJacobi(s...) = NormalizedPolynomialSpace(Jacobi(s...))
2323
NormalizedLegendre(d...) = NormalizedPolynomialSpace(Legendre(d...))
2424

2525
function normalization(::Type{T}, sp::Jacobi, k::Int) where T
26+
x = FastTransforms.Anαβ(k, sp.a, sp.b)
2627
if sp.a == sp.b == -0.5 && k == 0
2728
# In this case, the expression for Anαβ has a division by zero, so we evaluate this using Mathematica
2829
# In principle this may be generalized to arbitrary α + β = -1
2930
# The exact expression from Mathematica in terms of the hypergeometric 2F1 function
3031
# \fbox{$\frac{\, _2F_1(1,-\alpha ;\beta +2;-1)}{\beta +1}+\frac{\, _2F_1(1,-\beta ;\alpha +2;-1)}{\alpha +1}\text{ if }\alpha >-1\land \beta >-1$}
3132
# or, by eliminating β and expressed in terms of the polygamma function,
3233
# \fbox{$\frac{1}{2} \left(\psi ^{(0)}\left(\frac{1}{2}-\frac{\alpha }{2}\right)-\psi ^{(0)}\left(-\frac{\alpha }{2}\right)\right)+\frac{1}{2} \left(\psi ^{(0)}\left(\frac{\alpha }{2}+1\right)-\psi ^{(0)}\left(\frac{\alpha }{2}+\frac{1}{2}\right)\right)\text{ if }-1<\alpha <0$}
33-
T(pi)
34+
oftype(x, pi)
3435
else
35-
FastTransforms.Anαβ(T(k), T(sp.a), T(sp.b))
36+
x
3637
end
3738
end
3839

test/JacobiTest.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ using Static
192192
NormalizedUltraspherical(NormalizedPolynomialSpace(j))
193193
end
194194
end
195+
196+
@test ApproxFunOrthogonalPolynomials.normalization(ComplexF64, Jacobi(-0.5, -0.5), 0) pi
195197
end
196198

197199
@testset "inplace transform" begin

0 commit comments

Comments
 (0)