Skip to content

Commit

Permalink
refactor: use eltype of A.u or A.t instead of A
Browse files Browse the repository at this point in the history
  • Loading branch information
sathvikbhagavan committed May 6, 2024
1 parent 2038b26 commit a5ec8b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/integrals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function integral(A::AbstractInterpolation, t1::Number, t2::Number)
if A.t[idx2] == t2
idx2 -= 1
end
total = zero(eltype(A))
total = zero(eltype(A.u))
for idx in idx1:idx2
lt1 = idx == idx1 ? t1 : A.t[idx]
lt2 = idx == idx2 ? t2 : A.t[idx + 1]
Expand Down
2 changes: 1 addition & 1 deletion src/interpolation_methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ end
function _interpolate(A::LinearInterpolation{<:AbstractVector}, t::Number, iguess)
if isnan(t)
# For correct derivative with NaN
idx = firstindex(A) - 1
idx = firstindex(A.u) - 1
t1 = t2 = one(eltype(A.t))
u1 = u2 = one(eltype(A.u))
else
Expand Down

0 comments on commit a5ec8b7

Please sign in to comment.