diff --git a/src/jacobian.jl b/src/jacobian.jl index 55f1be3b7..0a5c645ee 100644 --- a/src/jacobian.jl +++ b/src/jacobian.jl @@ -150,10 +150,12 @@ function jacobian_autodiff(f, x::AbstractArray, nonlinfun, alg) num_of_chunks) end -function simple_jacobian(f, x::Number) - ForwardDiff.derivative(f, x) +function simple_jacobian(f, x::Number, p) + g = Base.Fix2(f, p) + ForwardDiff.derivative(g, x) end -function simple_jacobian(f, x::AbstractArray{<:Number}) - ForwardDiff.jacobian(f, x) +function simple_jacobian(f, x::AbstractArray{<:Number}, p) + g = Base.Fix2(f, p) + ForwardDiff.jacobian(g, x) end