Skip to content

Commit

Permalink
Update jacobians.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored Oct 19, 2018
1 parent 7425ed3 commit feae8a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/jacobians.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ function finite_difference_jacobian!(J::AbstractMatrix{<:Number},
f(fx, x)
@. J[:,i] = (vfx1 - vfx) / (2*epsilon)
else
fx1 = f(x1)
fx = f(x)
fx1 .= f(x1)
fx .= f(x)
J[:,i] = (vfx1 - vfx) / (2*epsilon)
end
x1[i] = x1_save
Expand All @@ -155,7 +155,7 @@ function finite_difference_jacobian!(J::AbstractMatrix{<:Number},
f(fx,x1)
@. J[:,i] = imag(vfx) / epsilon
else
fx = f(x1)
fx .= f(x1)
J[:,i] = imag(vfx) / epsilon
end
x1[i] = x1_save
Expand Down

0 comments on commit feae8a3

Please sign in to comment.