Skip to content

Commit 9a0fff4

Browse files
ensure we get from (-1/2,-1/2) to (1/2,1/2) before using tosquare/fromsquare and toline/fromline
1 parent 6d2bc1f commit 9a0fff4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/cjt.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function cjt(c::AbstractVector,plan::ChebyshevJacobiPlan)
1010
decrementα!(ret,α,β)
1111
elseif α == 0.5 && β == 0.5
1212
decrementαβ!(ret,α,β)
13-
else
14-
tosquare!(ret,α,β)
13+
elseif α != -0.5 && β != -0.5
14+
decrementαβ!(tosquare!(ret,α,β),half(α),half(β))
1515
end
1616
for i=1:N ret[i] *= Λ(i-1.0)/sqrtpi end
1717
return ret
@@ -28,7 +28,8 @@ function cjt(c::AbstractVector,plan::ChebyshevUltrasphericalPlan)
2828
N = length(c)
2929
N 1 && return c
3030
if modλ(λ) == 0
31-
ret = toline!(copy(c),λ-one(λ)/2-one(λ)/2)
31+
ret = copy(c)
32+
λ != 0.0 && (ret = decrementαβ!(toline!(ret,λ-one(λ)/2-one(λ)/2),half(λ),half(λ)))
3233
for i=1:N ret[i] *= Λ(i-1.0)/sqrtpi end
3334
return ret
3435
else
@@ -55,8 +56,8 @@ function icjt(c::AbstractVector,plan::ChebyshevJacobiPlan)
5556
elseif α == 0.5 && β == 0.5
5657
incrementαβ!(ret,α-1-1)
5758
return ret
58-
else
59-
return fromsquare!(ret,α,β)
59+
elseif α != -0.5 && β != -0.5
60+
return fromsquare!(incrementαβ!(ret,-half(α),-half(β)),α,β)
6061
end
6162
else
6263
# General half-open square
@@ -73,7 +74,7 @@ function icjt(c::AbstractVector,plan::ChebyshevUltrasphericalPlan)
7374
if modλ(λ) == 0
7475
ret = copy(c)
7576
for i=1:N ret[i] *= sqrtpi/Λ(i-1.0) end
76-
fromline!(ret,λ-one(λ)/2-one(λ)/2)
77+
λ != 0.0 && fromline!(incrementαβ!(ret,-half(λ),-half(λ))-one(λ)/2-one(λ)/2)
7778
return ret
7879
else
7980
# Ultraspherical line

0 commit comments

Comments
 (0)