Skip to content

Commit

Permalink
Fix rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Kolaru committed Dec 9, 2024
1 parent ebfe898 commit d774b67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ version = "0.22.19"

[deps]
CRlibm_jll = "4e9b3aee-d8a1-5a3d-ad8b-7d824db253f0"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
RoundingEmulator = "5eaf0fd0-dfba-4ccb-bf02-d820a40db705"

Expand All @@ -25,6 +26,7 @@ CRlibm_jll = "1"
DiffRules = "1"
ForwardDiff = "0.10"
IntervalSets = "0.7"
LinearAlgebra = "1.11.0"
MacroTools = "0.5"
RecipesBase = "1"
RoundingEmulator = "0.2"
Expand Down
8 changes: 2 additions & 6 deletions ext/IntervalArithmeticForwardDiffExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Dual{T}(x::ExactReal) where {T} = Dual{T, typeof(x), 0}(x.value)
Dual{T, V}(x::ExactReal) where {T, V<:Real} = convert(Dual{T, V, 0}, x)
Dual{T, V, N}(x::ExactReal) where {T, V<:Real, N} = convert(Dual{T, V, N}, x)

Base.convert(::Type{Dual{T, V, N}}, x::ExactReal) where {T, V, N} = promote_rule(Dual{T, V, N}, typeof(x))(x.value)
Base.convert(::Type{Dual{T,V,N}}, x::ExactReal) where {T,V,N} = Dual{T}(V(x), zero(Partials{N,V}))

Base.promote_rule(::Type{Dual{T, V, N}}, ::Type{Interval{S}}) where {T, V, N, S<:Union{AbstractFloat, Rational}} =
Dual{T,Interval{IntervalArithmetic.promote_numtype(V, S)},N}
Base.promote_rule(::Type{Interval{S}}, ::Type{ForwardDiff.Dual{T, V, N}}) where {S<:Union{AbstractFloat, Rational}, T, V, N} =
Base.promote_rule(::Type{Interval{S}}, ::Type{Dual{T, V, N}}) where {S<:Union{AbstractFloat, Rational}, T, V, N} =
Dual{T,Interval{IntervalArithmetic.promote_numtype(V, S)},N}
Base.promote_rule(::Type{ExactReal{S}}, ::Type{Dual{T, V, N}}) where {S<:Real, T, V, N} =
Dual{T,ExactReal{IntervalArithmetic.promote_numtype(V, S)},N}
Expand Down Expand Up @@ -90,8 +90,4 @@ function Base.:(^)(x::ExactReal, y::Dual{<:Ty}) where {Ty}
end
end

# resolve ambiguity

Base.convert(::Type{Dual{T,V,N}}, x::ExactReal) where {T,V,N} = Dual{T}(V(x), zero(Partials{N,V}))

end

0 comments on commit d774b67

Please sign in to comment.