Skip to content

Commit

Permalink
fix(LinearInterpolation): better check for arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutosh-b-b committed Sep 23, 2024
1 parent 2ffef8d commit 9530aa6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parameter_caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function safe_diff(b, a::T) where {T}
b == a ? zero(T) : b - a
end

function linear_interpolation_parameters(u::AbstractArray{T}, t, idx) where {T}
Δu = if u isa AbstractArray
function linear_interpolation_parameters(u::AbstractArray{T, N}, t, idx) where {T, N}
Δu = if N > 1
ax = axes(u)
safe_diff.(u[ax[1:end-1]..., idx+1:idx+1] , u[ax[1:end-1]..., idx:idx])
else
Expand Down

0 comments on commit 9530aa6

Please sign in to comment.