Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Jul 9, 2024
1 parent aa23c78 commit 436ac01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/DataInterpolationsChainRulesCoreExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ end
function ChainRulesCore.rrule(::typeof(interpolation_parameters),
::Val{:QuadraticSpline},
z::AbstractVector, t::AbstractVector, idx::Integer)
σ = interpolation_parameters(Val(:QuadraticSpline), z, t, idx)s
σ = interpolation_parameters(Val(:QuadraticSpline), z, t, idx)
dz = SparseVector(length(z), [idx, idx + 1], zeros(2))
Δt = t[idx + 1] - t[idx]

Expand Down
2 changes: 1 addition & 1 deletion src/interpolation_caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ function QuadraticSpline(
# zero for element type of d, which we don't know yet
typed_zero = zero(2 // 1 * (u[begin + 1] - u[begin]) / (t[begin + 1] - t[begin]))

d = map(i -> i == 1 ? typed_zero : 2 // 1 * (u[i] - u[i - 1]) / (t[i] - t[i - 1]), 1:s)
d = [2 // 1 * (u[i] - u[max(1, i - 1)]) / (t[i] - t[1 + abs(i - 2)]) for i in eachindex(t)]
z = tA \ d
p = QuadraticSplineParameterCache(z, t)
A = QuadraticSpline(u, t, nothing, p, tA, d, z, extrapolate, safetycopy)
Expand Down

0 comments on commit 436ac01

Please sign in to comment.