diff --git a/src/DataInterpolations.jl b/src/DataInterpolations.jl index 18249393..ec303df0 100644 --- a/src/DataInterpolations.jl +++ b/src/DataInterpolations.jl @@ -29,7 +29,9 @@ include("show.jl") (interp::AbstractInterpolation)(t::Number) = _interpolate(interp, t) (interp::AbstractInterpolation)(t::Number, i::Integer) = _interpolate(interp, t, i) -(interp::AbstractInterpolation)(t::AbstractVector) = interp(similar(t, promote_type(eltype(interp), eltype(t))), t) +function (interp::AbstractInterpolation)(t::AbstractVector) + interp(similar(t, promote_type(eltype(interp), eltype(t))), t) +end function (interp::AbstractInterpolation)(u::AbstractVector, t::AbstractVector) iguess = firstindex(interp.t) @inbounds for i in eachindex(u, t) diff --git a/test/derivative_tests.jl b/test/derivative_tests.jl index a3f08ddf..9f3449da 100644 --- a/test/derivative_tests.jl +++ b/test/derivative_tests.jl @@ -223,11 +223,11 @@ end @testset "Jacobian tests" begin u = rand(5) t = 0:4 - interp = LinearInterpolation(u, t,extrapolate=true) - grad1 = ForwardDiff.derivative(interp,2.4) + interp = LinearInterpolation(u, t, extrapolate = true) + grad1 = ForwardDiff.derivative(interp, 2.4) - myvec = rand(20).*4.0 + myvec = rand(20) .* 4.0 interp(myvec) - grad = ForwardDiff.jacobian(interp,myvec) + grad = ForwardDiff.jacobian(interp, myvec) end