Skip to content

Commit 3d35a20

Browse files
committed
Check if parameters are equal in jjt
1 parent 2c0f8ec commit 3d35a20

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/cjt.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,14 @@ given the Jacobi expansion coefficients ``c`` with parameters ``α`` and ``β``.
140140
141141
See also [`cjt`](#method__cjt.1) and [`icjt`](#method__icjt.1).
142142
"""
143-
jjt(c,α,β,γ,δ) = icjt(cjt(c,α,β),γ,δ)
143+
function jjt(c,α,β,γ,δ)
144+
if isapprox(α,γ) && isapprox(β,δ)
145+
copy(c)
146+
else
147+
icjt(cjt(c,α,β),γ,δ)
148+
end
149+
end
150+
144151

145152
"""
146153
Pre-plan optimized DCT-I and DST-I plans and pre-allocate the necessary

test/runtests.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ pop!(c)
8888
c = [1.0;2.0]
8989
@test norm(jjt(c,0.12,0.34,0.12,0.34)-c,Inf) 2eps()
9090

91+
92+
# test same parameters
93+
94+
c=[0.,1.]
95+
@test jjt(c,1.5,-0.5,1.5,-0.5) == c
96+
9197
println("Testing the special cases (α,β) = (±0.5,±0.5)")
9298

9399
# Chebyshev coefficients of exp

0 commit comments

Comments
 (0)