Skip to content

Commit

Permalink
Merge bd8e9ba into 4842972
Browse files Browse the repository at this point in the history
  • Loading branch information
ararslan committed Aug 4, 2017
2 parents 4842972 + bd8e9ba commit 04b03c0
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ os:
- linux
- osx
julia:
- 0.5
- 0.6
- nightly
notifications:
email: false
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Most of these functions were formerly part of Base.
[![Coverage Status](https://coveralls.io/repos/github/JuliaMath/SpecialFunctions.jl/badge.svg?branch=master)](https://coveralls.io/github/JuliaMath/SpecialFunctions.jl?branch=master)

Latest release:
[![SpecialFunctions](http://pkg.julialang.org/badges/SpecialFunctions_0.5.svg)](http://pkg.julialang.org/?pkg=SpecialFunctions)
[![SpecialFunctions](http://pkg.julialang.org/badges/SpecialFunctions_0.6.svg)](http://pkg.julialang.org/?pkg=SpecialFunctions)

Documentation:
Expand Down
3 changes: 1 addition & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
julia 0.5
Compat 0.18.0
julia 0.6
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
environment:
matrix:
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"

Expand Down
106 changes: 51 additions & 55 deletions src/SpecialFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,57 @@ __precompile__()

module SpecialFunctions

using Compat

if VERSION >= v"0.6.0-dev.2767"
if isdefined(Base, :airyai) && VERSION < v"0.7.0-DEV.986" #22763
import Base: airyai, airyaix, airyaiprime, airyaiprimex,
airybi, airybix, airybiprime, airybiprimex,
besselh, besselhx, besseli, besselix, besselj, besselj0, besselj1,
besseljx, besselk, besselkx, bessely, bessely0, bessely1, besselyx,
hankelh1, hankelh1x, hankelh2, hankelh2x,
dawson, erf, erfc, erfcinv, erfcx, erfi, erfinv,
eta, digamma, invdigamma, polygamma, trigamma, zeta,
# deprecated
airy, airyx, airyprime
else
export
airyai,
airyaiprime,
airybi,
airybiprime,
airyaix,
airyaiprimex,
airybix,
airybiprimex,
besselh,
besselhx,
besseli,
besselix,
besselj,
besselj0,
besselj1,
besseljx,
besselk,
besselkx,
bessely,
bessely0,
bessely1,
besselyx,
dawson,
erf,
erfc,
erfcinv,
erfcx,
erfi,
erfinv,
eta,
digamma,
invdigamma,
polygamma,
trigamma,
hankelh1,
hankelh1x,
hankelh2,
hankelh2x,
zeta
end
if isdefined(Base, :airyai) && VERSION < v"0.7.0-DEV.986" #22763
import Base: airyai, airyaix, airyaiprime, airyaiprimex,
airybi, airybix, airybiprime, airybiprimex,
besselh, besselhx, besseli, besselix, besselj, besselj0, besselj1,
besseljx, besselk, besselkx, bessely, bessely0, bessely1, besselyx,
hankelh1, hankelh1x, hankelh2, hankelh2x,
dawson, erf, erfc, erfcinv, erfcx, erfi, erfinv,
eta, digamma, invdigamma, polygamma, trigamma, zeta,
# deprecated
airy, airyx, airyprime
else
export
airyai,
airyaiprime,
airybi,
airybiprime,
airyaix,
airyaiprimex,
airybix,
airybiprimex,
besselh,
besselhx,
besseli,
besselix,
besselj,
besselj0,
besselj1,
besseljx,
besselk,
besselkx,
bessely,
bessely0,
bessely1,
besselyx,
dawson,
erf,
erfc,
erfcinv,
erfcx,
erfi,
erfinv,
eta,
digamma,
invdigamma,
polygamma,
trigamma,
hankelh1,
hankelh1x,
hankelh2,
hankelh2x,
zeta
end

export sinint,
Expand Down
8 changes: 4 additions & 4 deletions src/bessel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using Base.Math: nan_dom_err

type AmosException <: Exception
struct AmosException <: Exception
info::Int32
end

Expand Down Expand Up @@ -112,7 +112,7 @@ for afn in (:airyai, :airyaiprime, :airybi, :airybiprime,
:airyaix, :airyaiprimex, :airybix, :airybiprimex)
@eval begin
$afn(z::Complex) = $afn(float(z))
$afn{T<:AbstractFloat}(z::Complex{T}) = throw(MethodError($afn,(z,)))
$afn(z::Complex{<:AbstractFloat}) = throw(MethodError($afn,(z,)))
$afn(z::Complex64) = Complex64($afn(Complex128(z)))
end
if afn in (:airyaix, :airyaiprimex)
Expand Down Expand Up @@ -454,7 +454,7 @@ for f in ("i", "ix", "j", "jx", "k", "kx", "y", "yx")
Tf = promote_type(float(typeof(nu)),float(typeof(real(z))))
$bfn(Tf(nu), Complex{Tf}(z))
end
$bfn{T<:AbstractFloat}(k::T, z::Complex{T}) = throw(MethodError($bfn,(k,z)))
$bfn(k::T, z::Complex{T}) where {T<:AbstractFloat} = throw(MethodError($bfn,(k,z)))
$bfn(nu::Float32, x::Complex64) = Complex64($bfn(Float64(nu), Complex128(x)))
end
end
Expand All @@ -471,7 +471,7 @@ for bfn in (:besselh, :besselhx)
$bfn(Tf(nu), k, Complex{Tf}(z))
end

$bfn{T<:AbstractFloat}(nu::T, k::Integer, z::Complex{T}) = throw(MethodError($bfn,(nu,k,z)))
$bfn(nu::T, k::Integer, z::Complex{T}) where {<:AbstractFloat} = throw(MethodError($bfn,(nu,k,z)))
$bfn(nu::Float32, k::Integer, x::Complex64) = Complex64($bfn(Float64(nu), k, Complex128(x)))
end
end
Expand Down
30 changes: 1 addition & 29 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
# This file contains code that was formerly a part of Julia. License is MIT: http://julialang.org/license

using Base: @deprecate, depwarn
using Compat: @dep_vectorize_1arg, @dep_vectorize_2arg

for f in (:digamma, :trigamma, :zeta, :eta, :erfcx, :erfi, :dawson, :airyai, :airyaiprime,
:airybi, :airybiprime, :besselj0, :besselj1, :bessely0, :bessely1, :erf, :erfc)
@eval @dep_vectorize_1arg Number $f
end

for f in (:invdigamma, :erfinc, :erfcinv)
@eval @dep_vectorize_1arg Real $f
end

for f in (:polygamma, :zeta, :besseli, :besselix, :besselj, :besseljx, :besselk, :besselkx,
:bessely, :besselyx, :besselh, :besselhx, :hankelh1, :hankelh2, :hankelh1x, :hankelh2x)
@eval @dep_vectorize_2arg Number $f
end

@deprecate airy(z::Number) airyai(z)
@deprecate airyx(z::Number) airyaix(z)
@deprecate airyprime(z::Number) airyaiprime(z)
@deprecate airy{T<:Number}(x::AbstractArray{T}) airyai.(x)
@deprecate airyx{T<:Number}(x::AbstractArray{T}) airyaix.(x)
@deprecate airyprime{T<:Number}(x::AbstractArray{T}) airyprime.(x)

function _airy(k::Integer, z::Complex128)
depwarn("`airy(k,x)` is deprecated, use `airyai(x)`, `airyaiprime(x)`, `airybi(x)` or `airybiprime(x)` instead.",:airy)
Expand Down Expand Up @@ -59,19 +41,9 @@ for afn in (:airy,:airyx)
end

$afn(k::Integer, z::Complex) = $afn(k, float(z))
$afn{T<:AbstractFloat}(k::Integer, z::Complex{T}) = throw(MethodError($afn,(k,z)))
$afn(k::Integer, z::Complex{<:AbstractFloat}) = throw(MethodError($afn,(k,z)))
$afn(k::Integer, z::Complex64) = Complex64($afn(k, Complex128(z)))
$afn(k::Integer, x::Real) = $afn(k, float(x))
$afn(k::Integer, x::AbstractFloat) = real($afn(k, complex(x)))

function $afn{T<:Number}(k::Number, x::AbstractArray{T})
$afn.(k,x)
end
function $afn{S<:Number}(k::AbstractArray{S}, x::Number)
$afn.(k,x)
end
function $afn{S<:Number,T<:Number}(k::AbstractArray{S}, x::AbstractArray{T})
$afn.(k,x)
end
end
end
2 changes: 1 addition & 1 deletion src/gamma.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using Base.MPFR: ROUNDING_MODE, big_ln2

@compat ComplexOrReal{T} = Union{T,Complex{T}}
ComplexOrReal{T} = Union{T,Complex{T}}

# Bernoulli numbers B_{2k}, using tabulated numerators and denominators from
# the online encyclopedia of integer sequences. (They actually have data
Expand Down

0 comments on commit 04b03c0

Please sign in to comment.