Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
sathvikbhagavan committed Mar 5, 2024
1 parent 2e05ec1 commit fd1b4a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/DataInterpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions test/derivative_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fd1b4a8

Please sign in to comment.