Skip to content

Commit 3e8fb7a

Browse files
committed
Remove some special functions from Base
1 parent 7f34449 commit 3e8fb7a

15 files changed

+33
-1956
lines changed

base/deprecated.jl

+21-73
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,9 @@ for f in (
226226
# base/special/log.jl
227227
:log, :log1p,
228228
# base/special/gamma.jl
229-
:gamma, :lfact, :digamma, :trigamma, :zeta, :eta,
230-
# base/special/erf.jl
231-
:erfcx, :erfi, :dawson,
232-
# base/special/bessel.jl
233-
:airyai, :airyaiprime, :airybi, :airybiprime,
234-
:besselj0, :besselj1, :bessely0, :bessely1,
229+
:gamma, :lfact,
235230
# base/math.jl
236-
:cbrt, :sinh, :cosh, :tanh, :atan, :asinh, :exp, :erf, :erfc, :exp2,
231+
:cbrt, :sinh, :cosh, :tanh, :atan, :asinh, :exp, :exp2,
237232
:expm1, :exp10, :sin, :cos, :tan, :asin, :acos, :acosh, :atanh,
238233
#=:log,=# :log2, :log10, :lgamma, #=:log1p,=# :sqrt,
239234
# base/floatfuncs.jl
@@ -252,8 +247,6 @@ for f in ( :acos_fast, :acosh_fast, :angle_fast, :asin_fast, :asinh_fast,
252247
@eval FastMath Base.@dep_vectorize_1arg Number $f
253248
end
254249
for f in (
255-
:invdigamma, # base/special/gamma.jl
256-
:erfinc, :erfcinv, # base/special/erf.jl
257250
:trunc, :floor, :ceil, :round, # base/floatfuncs.jl
258251
:rad2deg, :deg2rad, :exponent, :significand, # base/math.jl
259252
:sind, :cosd, :tand, :asind, :acosd, :atand, :asecd, :acscd, :acotd, # base/special/trig.jl
@@ -292,11 +285,7 @@ end
292285
# Deprecate @vectorize_2arg-vectorized functions from...
293286
for f in (
294287
# base/special/gamma.jl
295-
:polygamma, :zeta, :beta, :lbeta,
296-
# base/special/bessel.jl
297-
:besseli, :besselix, :besselj, :besseljx,
298-
:besselk, :besselkx, :bessely, :besselyx, :besselh,
299-
:besselhx, :hankelh1, :hankelh2, :hankelh1x, :hankelh2x,
288+
:beta, :lbeta,
300289
# base/math.jl
301290
:log, :hypot, :atan2,
302291
)
@@ -672,65 +661,6 @@ end
672661
# Deprecate isimag (#19947).
673662
@deprecate isimag(z::Number) iszero(real(z))
674663

675-
@deprecate airy(z::Number) airyai(z)
676-
@deprecate airyx(z::Number) airyaix(z)
677-
@deprecate airyprime(z::Number) airyaiprime(z)
678-
@deprecate airy{T<:Number}(x::AbstractArray{T}) airyai.(x)
679-
@deprecate airyx{T<:Number}(x::AbstractArray{T}) airyaix.(x)
680-
@deprecate airyprime{T<:Number}(x::AbstractArray{T}) airyprime.(x)
681-
682-
function _airy(k::Integer, z::Complex128)
683-
depwarn("`airy(k,x)` is deprecated, use `airyai(x)`, `airyaiprime(x)`, `airybi(x)` or `airybiprime(x)` instead.",:airy)
684-
id = Int32(k==1 || k==3)
685-
if k == 0 || k == 1
686-
return Base.Math._airy(z, id, Int32(1))
687-
elseif k == 2 || k == 3
688-
return Base.Math._biry(z, id, Int32(1))
689-
else
690-
throw(ArgumentError("k must be between 0 and 3"))
691-
end
692-
end
693-
function _airyx(k::Integer, z::Complex128)
694-
depwarn("`airyx(k,x)` is deprecated, use `airyaix(x)`, `airyaiprimex(x)`, `airybix(x)` or `airybiprimex(x)` instead.",:airyx)
695-
id = Int32(k==1 || k==3)
696-
if k == 0 || k == 1
697-
return Base.Math._airy(z, id, Int32(2))
698-
elseif k == 2 || k == 3
699-
return Base.Math._biry(z, id, Int32(2))
700-
else
701-
throw(ArgumentError("k must be between 0 and 3"))
702-
end
703-
end
704-
705-
for afn in (:airy,:airyx)
706-
_afn = Symbol("_"*string(afn))
707-
suf = string(afn)[5:end]
708-
@eval begin
709-
function $afn(k::Integer, z::Complex128)
710-
afn = $(QuoteNode(afn))
711-
suf = $(QuoteNode(suf))
712-
depwarn("`$afn(k,x)` is deprecated, use `airyai$suf(x)`, `airyaiprime$suf(x)`, `airybi$suf(x)` or `airybiprime$suf(x)` instead.",$(QuoteNode(afn)))
713-
$_afn(k,z)
714-
end
715-
716-
$afn(k::Integer, z::Complex) = $afn(k, float(z))
717-
$afn{T<:AbstractFloat}(k::Integer, z::Complex{T}) = throw(MethodError($afn,(k,z)))
718-
$afn(k::Integer, z::Complex64) = Complex64($afn(k, Complex128(z)))
719-
$afn(k::Integer, x::Real) = $afn(k, float(x))
720-
$afn(k::Integer, x::AbstractFloat) = real($afn(k, complex(x)))
721-
722-
function $afn{T<:Number}(k::Number, x::AbstractArray{T})
723-
$afn.(k,x)
724-
end
725-
function $afn{S<:Number}(k::AbstractArray{S}, x::Number)
726-
$afn.(k,x)
727-
end
728-
function $afn{S<:Number,T<:Number}(k::AbstractArray{S}, x::AbstractArray{T})
729-
$afn.(k,x)
730-
end
731-
end
732-
end
733-
734664
# Deprecate vectorized xor in favor of compact broadcast syntax
735665
@deprecate xor(a::Bool, B::BitArray) xor.(a, B)
736666
@deprecate xor(A::BitArray, b::Bool) xor.(A, b)
@@ -1227,6 +1157,24 @@ for name in ("alnum", "alpha", "cntrl", "digit", "number", "graph",
12271157
@eval @deprecate ($f)(s::AbstractString) all($f, s)
12281158
end
12291159

1160+
# Special functions have been moved to a package
1161+
for f in (:airyai, :airyaiprime, :airybi, :airybiprime, :airyaix, :airyaiprimex, :airybix, :airybiprimex,
1162+
:besselh, :besselhx, :besseli, :besselix, :besselj, :besselj0, :besselj1, :besseljx, :besselk,
1163+
:besselkx, :bessely, :bessely0, :bessely1, :besselyx,
1164+
:dawson, :erf, :erfc, :erfcinv, :erfcx, :erfi, :erfinv,
1165+
:eta, :zeta, :digamma, :invdigamma, :polygamma, :trigamma,
1166+
:hankelh1, :hankelh1x, :hankelh2, :hankelh2x,
1167+
:airy, :airyx, :airyprime)
1168+
@eval begin
1169+
function $f(args...; kwargs...)
1170+
error(string($f, args, " has been moved to the package SpecialFunctions.jl.\n",
1171+
"Run Pkg.add(\"SpecialFunctions\") to install SpecialFunctions on Julia v0.6 and later,\n",
1172+
"and then run `using SpecialFunctions`."))
1173+
end
1174+
export $f
1175+
end
1176+
end
1177+
12301178
# END 0.6 deprecations
12311179

12321180
# BEGIN 1.0 deprecations

base/docs/helpdb/Base.jl

-66
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,6 @@ This would create a 25-by-30000 `BitArray`, linked to the file associated with s
304304
"""
305305
Mmap.mmap(io, ::BitArray, dims = ?, offset = ?)
306306

307-
"""
308-
bessely0(x)
309-
310-
Bessel function of the second kind of order 0, ``Y_0(x)``.
311-
"""
312-
bessely0
313-
314307
"""
315308
filter!(function, collection)
316309
@@ -647,13 +640,6 @@ for use in `Mmap.mmap`. Used by `SharedArray` for creating shared memory arrays.
647640
"""
648641
Mmap.Anonymous
649642

650-
"""
651-
erfi(x)
652-
653-
Compute the imaginary error function of `x`, defined by ``-i \\operatorname{erf}(ix)``.
654-
"""
655-
erfi
656-
657643
"""
658644
floor([T,] x, [digits, [base]])
659645
@@ -695,13 +681,6 @@ The item or field is not defined for the given object.
695681
"""
696682
UndefRefError
697683

698-
"""
699-
bessely1(x)
700-
701-
Bessel function of the second kind of order 1, ``Y_1(x)``.
702-
"""
703-
bessely1
704-
705684
"""
706685
append!(collection, collection2) -> collection.
707686
@@ -798,13 +777,6 @@ julia> getfield(a, :num)
798777
"""
799778
getfield
800779

801-
"""
802-
besselj1(x)
803-
804-
Bessel function of the first kind of order 1, ``J_1(x)``.
805-
"""
806-
besselj1
807-
808780
"""
809781
select!(v, k, [by=<transform>,] [lt=<comparison>,] [rev=false])
810782
@@ -933,35 +905,13 @@ behavior, including program corruption or segfaults, at any later time.
933905
"""
934906
unsafe_convert
935907

936-
"""
937-
erfinv(x)
938-
939-
Compute the inverse error function of a real `x`, defined by ``\\operatorname{erf}(\\operatorname{erfinv}(x)) = x``.
940-
"""
941-
erfinv
942-
943908
"""
944909
seek(s, pos)
945910
946911
Seek a stream to the given position.
947912
"""
948913
seek
949914

950-
"""
951-
besselj0(x)
952-
953-
Bessel function of the first kind of order 0, ``J_0(x)``.
954-
"""
955-
besselj0
956-
957-
"""
958-
erfcinv(x)
959-
960-
Compute the inverse error complementary function of a real `x`, defined by
961-
``\\operatorname{erfc}(\\operatorname{erfcinv}(x)) = x``.
962-
"""
963-
erfcinv
964-
965915
"""
966916
popdisplay()
967917
popdisplay(d::Display)
@@ -1605,14 +1555,6 @@ Equivalent to [`readdlm`](@ref) with `delim` set to comma, and type optionally d
16051555
"""
16061556
readcsv
16071557

1608-
"""
1609-
erfcx(x)
1610-
1611-
Compute the scaled complementary error function of `x`, defined by ``e^{x^2} \\operatorname{erfc}(x)``.
1612-
Note also that ``\\operatorname{erfcx}(-ix)`` computes the Faddeeva function ``w(x)``.
1613-
"""
1614-
erfcx
1615-
16161558
"""
16171559
UndefVarError(var::Symbol)
16181560
@@ -2482,11 +2424,3 @@ seekend
24822424
Integer division was attempted with a denominator value of 0.
24832425
"""
24842426
DivideError
2485-
2486-
"""
2487-
dawson(x)
2488-
2489-
Compute the Dawson function (scaled imaginary error function) of `x`, defined by
2490-
``\\frac{\\sqrt{\\pi}}{2} e^{-x^2} \\operatorname{erfi}(x)``.
2491-
"""
2492-
dawson

base/exports.jl

-39
Original file line numberDiff line numberDiff line change
@@ -309,19 +309,11 @@ export
309309
csc,
310310
cscd,
311311
csch,
312-
dawson,
313312
deg2rad,
314313
denominator,
315-
digamma,
316314
div,
317315
divrem,
318316
eps,
319-
erf,
320-
erfc,
321-
erfcinv,
322-
erfcx,
323-
erfi,
324-
erfinv,
325317
exp,
326318
exp10,
327319
exp2,
@@ -345,7 +337,6 @@ export
345337
hypot,
346338
imag,
347339
inv,
348-
invdigamma,
349340
invmod,
350341
isapprox,
351342
iseven,
@@ -416,7 +407,6 @@ export
416407
tanh,
417408
trailing_ones,
418409
trailing_zeros,
419-
trigamma,
420410
trunc,
421411
unsafe_trunc,
422412
typemax,
@@ -430,37 +420,8 @@ export
430420
,
431421

432422
# specfun
433-
airyai,
434-
airyaiprime,
435-
airybi,
436-
airybiprime,
437-
airyaix,
438-
airyaiprimex,
439-
airybix,
440-
airybiprimex,
441-
besselh,
442-
besselhx,
443-
besseli,
444-
besselix,
445-
besselj,
446-
besselj0,
447-
besselj1,
448-
besseljx,
449-
besselk,
450-
besselkx,
451-
bessely,
452-
bessely0,
453-
bessely1,
454-
besselyx,
455423
beta,
456-
eta,
457-
hankelh1,
458-
hankelh1x,
459-
hankelh2,
460-
hankelh2x,
461424
lbeta,
462-
polygamma,
463-
zeta,
464425

465426
# arrays
466427
broadcast!,

0 commit comments

Comments
 (0)