Skip to content

Commit 055248f

Browse files
authored
Update specialfunctions.jl
1 parent 2d371f2 commit 055248f

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/specialfunctions.jl

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,7 @@ function pochhammer(x::Number,n::Integer)
4545
ret
4646
end
4747

48-
pochhammer(x::AbstractArray{T,1},n::Integer) where {T<:Number} = [pochhammer(x[i],n) for i=1:length(x)]
49-
pochhammer(x::AbstractArray{T,2},n::Integer) where {T<:Number} = [pochhammer(x[i,j],n) for i=1:size(x,1),j=1:size(x,2)]
50-
pochhammer(x::AbstractArray{T},n::Integer) where {T<:Number} = reshape([ pochhammer(x[i],n) for i in eachindex(x) ], size(x))
51-
5248
pochhammer(x::Number,n::Number) = isinteger(n) ? pochhammer(x,Int(n)) : ogamma(x)/ogamma(x+n)
53-
pochhammer(x::AbstractArray{T},n::Number) where {T<:Number} = isinteger(n) ? pochhammer(x,Int(n)) : ogamma.(x)./ogamma.(x.+n)
5449

5550
function pochhammer(x::Number,n::UnitRange{T}) where T<:Real
5651
ret = Vector{promote_type(typeof(x),T)}(length(n))
@@ -61,13 +56,7 @@ function pochhammer(x::Number,n::UnitRange{T}) where T<:Real
6156
ret
6257
end
6358

64-
function ogamma(x::Number)
65-
if isinteger(x) && x<0
66-
zero(float(x))
67-
else
68-
inv(gamma(x))
69-
end
70-
end
59+
ogamma(x::Number) = (isinteger(x) && x<0) ? zero(float(x)) : inv(gamma(x))
7160

7261
"""
7362
Stirling's asymptotic series for ``\\Gamma(z)``.

0 commit comments

Comments
 (0)