diff --git a/src/parameter_caches.jl b/src/parameter_caches.jl index 824b2e2a..42d040e8 100644 --- a/src/parameter_caches.jl +++ b/src/parameter_caches.jl @@ -22,7 +22,7 @@ function linear_interpolation_parameters(u::AbstractArray{T, N}, t, idx) where { Δ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]) + u[ax[1:(end - 1)]..., (idx + 1)], u[ax[1:(end - 1)]..., idx]) else safe_diff(u[idx + 1], u[idx]) end diff --git a/test/interpolation_tests.jl b/test/interpolation_tests.jl index 69e5c197..3ebc1741 100644 --- a/test/interpolation_tests.jl +++ b/test/interpolation_tests.jl @@ -43,11 +43,11 @@ end A = LinearInterpolation(u, t; extrapolate = true) for (_t, _u) in zip(t, eachcol(u)) - @test A(_t) == reshape(_u, :, 1) + @test A(_t) == _u end - @test A(0) == [0.0; 0.0;;] - @test A(5.5) == [11.0; 16.5;;] - @test A(11) == [22; 33;;] + @test A(0) == [0.0, 0.0] + @test A(5.5) == [11.0, 16.5] + @test A(11) == [22, 33] x = 1:10 y = 2:4