Skip to content

Commit

Permalink
fix(BSplineApprox): fix bug while extrapolate for AbstractArray
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutosh-b-b committed Oct 21, 2024
1 parent 51349d0 commit 623470d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/interpolation_methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ end

function _interpolate(
A::BSplineApprox{<:AbstractArray{T, N}}, t::Number, iguess) where {T <: Number, N}
t < A.t[1] && return A.u[1]
t > A.t[end] && return A.u[end]
# change t into param [0 1]
ax_u = axes(A.u)[1:(end - 1)]
t < A.t[1] && return A.u[ax_u..., 1]
t > A.t[end] && return A.u[ax_u..., end]
# change t into param [0 1]
idx = get_idx(A, t, iguess)
t = A.p[idx] + (t - A.t[idx]) / (A.t[idx + 1] - A.t[idx]) * (A.p[idx + 1] - A.p[idx])
sc = t isa ForwardDiff.Dual ? zeros(eltype(t), A.h) : A.sc
Expand Down

0 comments on commit 623470d

Please sign in to comment.