Skip to content

Commit

Permalink
use current alg autodiff
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jun 7, 2018
1 parent b488538 commit 92a12cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/derivative_wrappers.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function derivative!(df::AbstractArray{<:Number}, f, x::Union{Number,AbstractArray{<:Number}}, fx::AbstractArray{<:Number}, integrator, grad_config)
if alg_autodiff(integrator.alg)
if get_current_alg_autodiff(integrator.alg, integrator.cache)
ForwardDiff.derivative!(df, f, fx, x, grad_config)
else
DiffEqDiffTools.finite_difference_gradient!(df, f, x, grad_config)
Expand All @@ -8,7 +8,7 @@ function derivative!(df::AbstractArray{<:Number}, f, x::Union{Number,AbstractArr
end

function jacobian!(J::AbstractMatrix{<:Number}, f, x::AbstractArray{<:Number}, fx::AbstractArray{<:Number}, integrator::DEIntegrator, jac_config)
if alg_autodiff(integrator.alg)
if get_current_alg_autodiff(integrator.alg, integrator.cache)
ForwardDiff.jacobian!(J, f, fx, x, jac_config)
else
DiffEqDiffTools.finite_difference_jacobian!(J, f, x, jac_config)
Expand Down

0 comments on commit 92a12cc

Please sign in to comment.