Skip to content

Commit

Permalink
Deprecate manually vectorized methods for trigonometric and hyperboli…
Browse files Browse the repository at this point in the history
…c functions in favor of compact broadcast syntax.
  • Loading branch information
Sacha0 committed Sep 18, 2016
1 parent 3a31155 commit ec42321
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 7 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1000,4 +1000,11 @@ macro vectorize_2arg(S,f)
end
export @vectorize_1arg, @vectorize_2arg

# Deprecate manually vectorized trigonometric and hyperbolic functions in favor of compact broadcast syntax
for f in (:sec, :sech, :secd, :asec, :asech,
:csc, :csch, :cscd, :acsc, :acsch,
:cot, :coth, :cotd, :acot, :acoth)
@eval @deprecate $f{T<:Number}(A::AbstractArray{T}) $f.(A)
end

# End deprecations scheduled for 0.6
3 changes: 0 additions & 3 deletions base/special/trig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ for (finv, f) in ((:sec, :cos), (:csc, :sin), (:cot, :tan),
(:secd, :cosd), (:cscd, :sind), (:cotd, :tand))
@eval begin
($finv){T<:Number}(z::T) = one(T) / (($f)(z))
($finv){T<:Number}(z::AbstractArray{T}) = one(T) ./ (($f)(z))
end
end

Expand All @@ -324,11 +323,9 @@ for (tfa, tfainv, hfa, hfainv, fn) in ((:asec, :acos, :asech, :acosh, "secant"),
@doc """
$($tname)(x)
Compute the inverse $($fn) of `x`, where the output is in radians. """ ($tfa){T<:Number}(y::T) = ($tfainv)(one(T) / y)
($tfa){T<:Number}(y::AbstractArray{T}) = ($tfainv)(one(T) ./ y)
@doc """
$($hname)(x)
Compute the inverse hyperbolic $($fn) of `x`. """ ($hfa){T<:Number}(y::T) = ($hfainv)(one(T) / y)
($hfa){T<:Number}(y::AbstractArray{T}) = ($hfainv)(one(T) ./ y)
end
end

Expand Down

0 comments on commit ec42321

Please sign in to comment.