From 393011dc9f126a29f31fd65246438082d8ef1083 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Mon, 16 Aug 2021 11:28:24 -0400 Subject: [PATCH] Fix inference specialization in interpolations Part of https://github.com/SciML/DifferentialEquations.jl/issues/786 --- src/solutions/dae_solutions.jl | 4 ++-- src/solutions/ode_solutions.jl | 4 ++-- src/solutions/rode_solutions.jl | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/solutions/dae_solutions.jl b/src/solutions/dae_solutions.jl index 61838cb94..667463483 100644 --- a/src/solutions/dae_solutions.jl +++ b/src/solutions/dae_solutions.jl @@ -15,8 +15,8 @@ struct DAESolution{T,N,uType,duType,uType2,DType,tType,P,A,ID,DE} <: AbstractDAE destats::DE retcode::Symbol end -(sol::DAESolution)(t,deriv::Type=Val{0};idxs=nothing,continuity=:left) = sol.interp(t,idxs,deriv,sol.prob.p,continuity) -(sol::DAESolution)(v,t,deriv::Type=Val{0};idxs=nothing,continuity=:left) = sol.interp(v,t,idxs,deriv,sol.prob.p,continuity) +(sol::DAESolution)(t,::Type{deriv}=Val{0};idxs=nothing,continuity=:left) where {deriv} = sol.interp(t,idxs,deriv,sol.prob.p,continuity) +(sol::DAESolution)(v,t,::Type{deriv}=Val{0};idxs=nothing,continuity=:left) where {deriv} = sol.interp(v,t,idxs,deriv,sol.prob.p,continuity) function build_solution(prob::AbstractDAEProblem, alg, t, u, du = nothing; timeseries_errors = length(u) > 2, diff --git a/src/solutions/ode_solutions.jl b/src/solutions/ode_solutions.jl index 8da39cda8..b9eaf085c 100644 --- a/src/solutions/ode_solutions.jl +++ b/src/solutions/ode_solutions.jl @@ -15,8 +15,8 @@ struct ODESolution{T,N,uType,uType2,DType,tType,rateType,P,A,IType,DE} <: Abstra destats::DE retcode::Symbol end -(sol::ODESolution)(t,deriv::Type=Val{0};idxs=nothing,continuity=:left) = sol(t,deriv,idxs,continuity) -(sol::ODESolution)(v,t,deriv::Type=Val{0};idxs=nothing,continuity=:left) = sol.interp(v,t,idxs,deriv,sol.prob.p,continuity) +(sol::ODESolution)(t,::Type{deriv}=Val{0};idxs=nothing,continuity=:left) where {deriv} = sol(t,deriv,idxs,continuity) +(sol::ODESolution)(v,t,::Type{deriv}=Val{0};idxs=nothing,continuity=:left) where {deriv} = sol.interp(v,t,idxs,deriv,sol.prob.p,continuity) function (sol::ODESolution)(t::Real,deriv,idxs::Nothing,continuity) sol.interp(t,idxs,deriv,sol.prob.p,continuity) diff --git a/src/solutions/rode_solutions.jl b/src/solutions/rode_solutions.jl index 26105d52f..468d5c986 100644 --- a/src/solutions/rode_solutions.jl +++ b/src/solutions/rode_solutions.jl @@ -18,8 +18,8 @@ struct RODESolution{T,N,uType,uType2,DType,tType,randType,P,A,IType,DE} <: Abstr retcode::Symbol seed::UInt64 end -(sol::RODESolution)(t,deriv::Type=Val{0};idxs=nothing,continuity=:left) = sol.interp(t,idxs,deriv,sol.prob.p,continuity) -(sol::RODESolution)(v,t,deriv::Type=Val{0};idxs=nothing,continuity=:left) = sol.interp(v,t,idxs,deriv,sol.prob.p,continuity) +(sol::RODESolution)(t,::Type{deriv}=Val{0};idxs=nothing,continuity=:left) where {deriv} = sol.interp(t,idxs,deriv,sol.prob.p,continuity) +(sol::RODESolution)(v,t,::Type{deriv}=Val{0};idxs=nothing,continuity=:left) where {deriv} = sol.interp(v,t,idxs,deriv,sol.prob.p,continuity) function build_solution( prob::Union{AbstractRODEProblem,AbstractSDDEProblem},