Skip to content

Commit

Permalink
Update oncedifferentiable.jl (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkofod authored Oct 10, 2018
1 parent 128b6f2 commit 095b2b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/objective_types/oncedifferentiable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ function OnceDifferentiable(f, x::AbstractArray, F::AbstractArray, DF::AbstractA
F
end
function j!(J, x)
F = similar(x)
fj!(F, J, x)
F_cache = similar(F)
fj!(F_cache, J, x)
end
return OnceDifferentiable(f, j!, fj!, x, F, DF)
elseif autodiff == :forward || autodiff == true
jac_cfg = ForwardDiff.JacobianConfig(f, F, x, chunk)
ForwardDiff.checktag(jac_cfg, f, x)

F2 = copy(x)
F2 = copy(F)
function g!(J, x)
ForwardDiff.jacobian!(J, f, F2, x, jac_cfg, Val{false}())
end
Expand Down

0 comments on commit 095b2b2

Please sign in to comment.