diff --git a/src/OptiMimi.jl b/src/OptiMimi.jl index 85b7331..9445158 100644 --- a/src/OptiMimi.jl +++ b/src/OptiMimi.jl @@ -1,7 +1,7 @@ module OptiMimi using NLopt -using ForwardDiff +using ForwardDiff, DiffBase using MathProgBase using Compat @@ -106,13 +106,13 @@ function autodiffobjective(model::Model, components::Vector{Symbol}, names::Vect end else function myobjective(xx::Vector, grad::Vector) - out = GradientResult(xx) + out = DiffBase.GradientResult(xx) ForwardDiff.gradient!(out, myunaryobjective, xx) - if any(isnan(ForwardDiff.gradient(out))) + if any(isnan(DiffBase.gradient(out))) error("objective gradient is NaN") end - copy!(grad, ForwardDiff.gradient(out)) - ForwardDiff.value(out) + copy!(grad, DiffBase.gradient(out)) + DiffBase.value(out) end end