Skip to content

Commit

Permalink
Merge fb4620e into b29f1ee
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Jun 17, 2019
2 parents b29f1ee + fb4620e commit 7f770c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/derivative_wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ function jacobian(f, x, integrator)
tmp = 1
else
J = jacobian_finitediff(f, x, alg.diff_type)
N = length(x)
if alg.diff_type==Val{:complex} && eltype(x)<:Real
tmp = length(x)
tmp = N
elseif alg.diff_type==Val{:forward}
tmp = N + 1
else
tmp = 2*length(x)
tmp = 2N
end
end
integrator.destats.nf += tmp
Expand Down
4 changes: 2 additions & 2 deletions test/interface/destats_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
using OrdinaryDiffEq, Test
x = Ref(0)
function f(u,p,t)
x[] += 1
return 5*u
x[] += 1
return 5*u
end
u0 = [1.0, 1.0]
tspan = (0.0,1.0)
Expand Down

0 comments on commit 7f770c6

Please sign in to comment.