Skip to content

Commit 3b7996c

Browse files
committed
Fix pochhammer for a vector of n
1 parent 9dead75 commit 3b7996c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "FastTransforms"
22
uuid = "057dd010-8810-581a-b7be-e3fc3b93f78c"
3-
version = "0.16.2"
3+
version = "0.16.3"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/specialfunctions.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ end
4848
pochhammer(x::Number,n::Number) = isinteger(n) ? pochhammer(x,Int(n)) : ogamma(x)/ogamma(x+n)
4949

5050
function pochhammer(x::Number,n::UnitRange{T}) where T<:Real
51-
ret = Vector{promote_type(typeof(x),T)}(length(n))
51+
ret = Vector{promote_type(typeof(x),T)}(undef,length(n))
5252
ret[1] = pochhammer(x,first(n))
5353
for i=2:length(n)
5454
ret[i] = (x+n[i]-1)*ret[i-1]

test/specialfunctionstests.jl

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import FastTransforms: chebyshevmoments1, chebyshevmoments2, chebyshevjacobimome
1818
@test pochhammer(1.1,2.2) gamma(3.3)/gamma(1.1)
1919
@test pochhammer(-2,1) == pochhammer(-2,1.0) == pochhammer(-2.0,1) == -2
2020

21+
@test pochhammer(2,0:5) == [pochhammer(2,i) for i in 0:5]
22+
2123
n = 0:1000
2224
λ = 0.125
2325
@test norm(Cnλ.(n, λ) ./ Cnλ.(n, big(λ)) .- 1, Inf) < 3eps()

0 commit comments

Comments
 (0)