From a5ec8b7e402feddb1d7c19b237177e853863c2b0 Mon Sep 17 00:00:00 2001 From: Sathvik Bhagavan Date: Mon, 6 May 2024 07:56:53 +0000 Subject: [PATCH] refactor: use eltype of A.u or A.t instead of A --- src/integrals.jl | 2 +- src/interpolation_methods.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/integrals.jl b/src/integrals.jl index 0e796d4d..e932bc5b 100644 --- a/src/integrals.jl +++ b/src/integrals.jl @@ -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] diff --git a/src/interpolation_methods.jl b/src/interpolation_methods.jl index 334ce030..e00adc59 100644 --- a/src/interpolation_methods.jl +++ b/src/interpolation_methods.jl @@ -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