Skip to content
Merged
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/interpolation_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ function get_parameters(A::QuinticHermiteSpline, idx)
end

function du_PCHIP(u, t)
h = diff(u)
δ = h ./ diff(t)
h = diff(t)
δ = diff(u) ./ h
s = sign.(δ)

function _du(k)
Expand All @@ -255,7 +255,7 @@ function du_PCHIP(u, t)
else
w₁ = 2h[k] + h[k - 1]
w₂ = h[k] + 2h[k - 1]
δ[k - 1] * δ[k] * (w₁ + w₂) / (w₁ * δ[k] + w₂ * δ[k - 1])
(w₁ + w₂) / (w₁ / δ[k - 1] + w₂ / δ[k])
end
else
zero(eltype(δ))
Expand Down
Loading