Skip to content

Commit ee80bbc

Browse files
authored
remove deprecated promote_array_type (#291)
1 parent 97f881c commit ee80bbc

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

src/dual.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,6 @@ Base.convert(::Type{Dual{T,V,N}}, d::Dual{T}) where {T,V<:Real,N} = Dual{T}(conv
305305
Base.convert(::Type{Dual{T,V,N}}, x::Real) where {T,V<:Real,N} = Dual{T}(V(x), zero(Partials{N,V}))
306306
Base.convert(::Type{D}, d::D) where {D<:Dual} = d
307307

308-
Base.promote_array_type(F, ::Type{D}, ::Type{A}) where {D<:Dual,A<:AbstractFloat} = promote_type(D, A)
309-
Base.promote_array_type(F, ::Type{<:Dual}, ::Type{<:AbstractFloat}, ::Type{P}) where {P} = P
310-
Base.promote_array_type(F, ::Type{A}, ::Type{D}) where {D<:Dual,A<:AbstractFloat} = promote_type(D, A)
311-
Base.promote_array_type(F, ::Type{<:AbstractFloat}, ::Type{<:Dual}, ::Type{P}) where {P} = P
312-
313308
Base.float(d::Dual{T,V,N}) where {T,V,N} = Dual{T,promote_type(V, Float16),N}(d)
314309
Base.AbstractFloat(d::Dual{T,V,N}) where {T,V,N} = Dual{T,promote_type(V, Float16),N}(d)
315310

test/DualTest.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -305,17 +305,6 @@ for N in (0,3), M in (0,4), V in (Int, Float32)
305305
@test convert(Dual{TestTag(),Dual{TestTag(),V,M},N}, FDNUM) === Dual{TestTag()}(Dual{TestTag(),V,M}(PRIMAL), convert(Partials{N,Dual{TestTag(),V,M}}, PARTIALS))
306306
@test convert(Dual{TestTag(),Dual{TestTag(),WIDE_T,M},N}, FDNUM) === Dual{TestTag()}(Dual{TestTag(),WIDE_T,M}(PRIMAL), convert(Partials{N,Dual{TestTag(),WIDE_T,M}}, PARTIALS))
307307

308-
if V != Int
309-
@test Base.promote_array_type(+, Dual{TestTag(),V,N}, V, Base.promote_op(+, Dual{TestTag(),V,N}, V)) == Dual{TestTag(),V,N}
310-
@test Base.promote_array_type(+, Dual{TestTag(),Int,N}, V, Base.promote_op(+, Dual{TestTag(),Int,N}, V)) == Dual{TestTag(),V,N}
311-
@test Base.promote_array_type(+, V, Dual{TestTag(),V,N}, Base.promote_op(+, V, Dual{TestTag(),V,N})) == Dual{TestTag(),V,N}
312-
@test Base.promote_array_type(+, V, Dual{TestTag(),Int,N}, Base.promote_op(+, V, Dual{TestTag(),Int,N})) == Dual{TestTag(),V,N}
313-
@test Base.promote_array_type(+, Dual{TestTag(),V,N}, V) == Dual{TestTag(),V,N}
314-
@test Base.promote_array_type(+, Dual{TestTag(),Int,N}, V) == Dual{TestTag(),V,N}
315-
@test Base.promote_array_type(+, V, Dual{TestTag(),V,N}) == Dual{TestTag(),V,N}
316-
@test Base.promote_array_type(+, V, Dual{TestTag(),Int,N}) == Dual{TestTag(),V,N}
317-
end
318-
319308
##############
320309
# Arithmetic #
321310
##############

0 commit comments

Comments
 (0)