Skip to content

Commit 789124c

Browse files
committed
Deprecate manually vectorized methods for trigonometric and hyperbolic functions in favor of compact broadcast syntax.
1 parent 44d7677 commit 789124c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

base/deprecated.jl

+8
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,7 @@ macro vectorize_2arg(S,f)
10031003
end
10041004
export @vectorize_1arg, @vectorize_2arg
10051005

1006+
<<<<<<< HEAD
10061007
# deprecations for uses of old dot operators (.* etc) as objects, rather than
10071008
# just calling them infix.
10081009
for op in (:(!=), :, :+, :-, :*, :/, :÷, :%, :<, :(<=), :, :(==), :>, :>=, :, :\, :^, ://, :>>, :<<)
@@ -1168,4 +1169,11 @@ for (dep, f, op) in [(:sumabs!, :sum!, :abs),
11681169
end
11691170
end
11701171

1172+
# Deprecate manually vectorized trigonometric and hyperbolic functions in favor of compact broadcast syntax
1173+
for f in (:sec, :sech, :secd, :asec, :asech,
1174+
:csc, :csch, :cscd, :acsc, :acsch,
1175+
:cot, :coth, :cotd, :acot, :acoth)
1176+
@eval @deprecate $f{T<:Number}(A::AbstractArray{T}) $f.(A)
1177+
end
1178+
11711179
# End deprecations scheduled for 0.6

base/special/trig.jl

-3
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ for (finv, f) in ((:sec, :cos), (:csc, :sin), (:cot, :tan),
311311
(:secd, :cosd), (:cscd, :sind), (:cotd, :tand))
312312
@eval begin
313313
($finv){T<:Number}(z::T) = one(T) / (($f)(z))
314-
($finv){T<:Number}(z::AbstractArray{T}) = one(T) ./ (($f)(z))
315314
end
316315
end
317316

@@ -324,11 +323,9 @@ for (tfa, tfainv, hfa, hfainv, fn) in ((:asec, :acos, :asech, :acosh, "secant"),
324323
@doc """
325324
$($tname)(x)
326325
Compute the inverse $($fn) of `x`, where the output is in radians. """ ($tfa){T<:Number}(y::T) = ($tfainv)(one(T) / y)
327-
($tfa){T<:Number}(y::AbstractArray{T}) = ($tfainv)(one(T) ./ y)
328326
@doc """
329327
$($hname)(x)
330328
Compute the inverse hyperbolic $($fn) of `x`. """ ($hfa){T<:Number}(y::T) = ($hfainv)(one(T) / y)
331-
($hfa){T<:Number}(y::AbstractArray{T}) = ($hfainv)(one(T) ./ y)
332329
end
333330
end
334331

0 commit comments

Comments
 (0)