Skip to content

Commit 34ec99d

Browse files
author
oscarddssmith
committed
fix interpolation type stability
1 parent 505c73d commit 34ec99d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/OrdinaryDiffEqCore/src/dense/generic_dense.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,8 @@ ode_interpolation(tvals,ts,timeseries,ks)
553553
Get the value at tvals where the solution is known at the
554554
times ts (sorted), with values timeseries and derivatives ks
555555
"""
556-
function ode_interpolation(tvals, id::I, idxs, deriv::D, p,
557-
continuity::Symbol = :left) where {I, D}
556+
function ode_interpolation(tvals, id::I, idxs, deriv::Type{deriv}, p,
557+
continuity::Symbol = :left) where {I, deriv}
558558
@unpack ts, timeseries, ks, f, cache, differential_vars = id
559559
@inbounds tdir = sign(ts[end] - ts[1])
560560
idx = sortperm(tvals, rev = tdir < 0)
@@ -575,7 +575,7 @@ function ode_interpolation(tvals, id::I, idxs, deriv::D, p,
575575
i₊ = i₋ < lastindex(ts) ? i₋ + 1 : i₋
576576
end
577577
id.sensitivitymode && error(SENSITIVITY_INTERP_MESSAGE)
578-
i₋₊ref[] = (i₋, i₊)
578+
i₋₊ref[] = (i₋, i₊)::Tuple{Int,Int}
579579
dt = ts[i₊] - ts[i₋]
580580
Θ = iszero(dt) ? oneunit(t) / oneunit(dt) : (t - ts[i₋]) / dt
581581
evaluate_interpolant(f, Θ, dt, timeseries, i₋, i₊, cache, idxs,
@@ -591,8 +591,8 @@ ode_interpolation(tvals,ts,timeseries,ks)
591591
Get the value at tvals where the solution is known at the
592592
times ts (sorted), with values timeseries and derivatives ks
593593
"""
594-
function ode_interpolation!(vals, tvals, id::I, idxs, deriv::D, p,
595-
continuity::Symbol = :left) where {I, D}
594+
function ode_interpolation!(vals, tvals, id::I, idxs, ::Type{deriv}, p,
595+
continuity::Symbol = :left) where {I, deriv}
596596
@unpack ts, timeseries, ks, f, cache, differential_vars = id
597597
@inbounds tdir = sign(ts[end] - ts[1])
598598
idx = sortperm(tvals, rev = tdir < 0)
@@ -756,8 +756,8 @@ ode_interpolation(tval::Number,ts,timeseries,ks)
756756
Get the value at tval where the solution is known at the
757757
times ts (sorted), with values timeseries and derivatives ks
758758
"""
759-
function ode_interpolation(tval::Number, id::I, idxs, deriv::D, p,
760-
continuity::Symbol = :left) where {I, D}
759+
function ode_interpolation(tval::Number, id::I, idxs, ::Type{deriv}, p,
760+
continuity::Symbol = :left) where {I, deriv}
761761
@unpack ts, timeseries, ks, f, cache, differential_vars = id
762762
@inbounds tdir = sign(ts[end] - ts[1])
763763

@@ -840,8 +840,8 @@ ode_interpolation!(out,tval::Number,ts,timeseries,ks)
840840
Get the value at tval where the solution is known at the
841841
times ts (sorted), with values timeseries and derivatives ks
842842
"""
843-
function ode_interpolation!(out, tval::Number, id::I, idxs, deriv::D, p,
844-
continuity::Symbol = :left) where {I, D}
843+
function ode_interpolation!(out, tval::Number, id::I, idxs, ::Type{deriv}, p,
844+
continuity::Symbol = :left) where {I, deriv}
845845
@unpack ts, timeseries, ks, f, cache, differential_vars = id
846846
@inbounds tdir = sign(ts[end] - ts[1])
847847

0 commit comments

Comments
 (0)