Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ext/DiffEqBaseForwardDiffExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,6 @@ if !hasmethod(nextfloat, Tuple{ForwardDiff.Dual})
end
end

# bisection(f, tup::Tuple{T,T}, t_forward::Bool) where {T<:ForwardDiff.Dual} = find_zero(f, tup, Roots.AlefeldPotraShi())

# Static Arrays don't support the `init` keyword argument for `sum`
@inline __sum(f::F, args...; init, kwargs...) where {F} = sum(f, args...; init, kwargs...)
@inline function __sum(
Expand Down
17 changes: 8 additions & 9 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,23 +190,22 @@ upconversion is not done automatically, the user is required to upconvert all in
themselves, for an example of how this can be confusing to a user see
https://discourse.julialang.org/t/typeerror-in-julia-turing-when-sampling-for-a-forced-differential-equation/82937
"""
@generated function anyeltypedual(x, ::Type{Val{counter}} = Val{0}) where {counter}
x = x.name === Core.Compiler.typename(Type) ? x.parameters[1] : x
if isdualtype(x)
:($x)
function anyeltypedual(x, ::Type{Val{counter}} = Val{0}) where {counter}
if isdualtype(typeof(x))
x
elseif fieldnames(x) === ()
:(Any)
Any
elseif counter < DUALCHECK_RECURSION_MAX
T = diffeqmapreduce(x -> anyeltypedual(x, Val{counter + 1}), promote_dual,
x.parameters)
if T === Any || isconcretetype(T)
:($T)
T
else
:(diffeqmapreduce(DualEltypeChecker($x, $counter + 1), promote_dual,
map(Val, fieldnames($(typeof(x))))))
diffeqmapreduce(DualEltypeChecker(typeof(x), counter + 1), promote_dual,
map(Val, fieldnames((typeof(x)))))
end
else
:(Any)
Any
end
end

Expand Down
Loading