Skip to content

Commit

Permalink
Merge pull request #67 from abelsiqueira/nojac
Browse files Browse the repository at this point in the history
Don't call jac_structure without constraints
  • Loading branch information
mlubin authored Dec 10, 2016
2 parents befd716 + 3fde126 commit 547915c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NLoptSolverInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function SolverInterface.loadproblem!(m::NLoptMathProgModel, numVar::Integer, nu
if isderivativefree
requested_features = Symbol[]
else
requested_features = [:Grad, :Jac]
requested_features = numConstr > 0 ? [:Grad, :Jac] : [:Grad]
end

SolverInterface.initialize(d, requested_features)
Expand All @@ -128,7 +128,7 @@ function SolverInterface.loadproblem!(m::NLoptMathProgModel, numVar::Integer, nu
max_objective!(m.opt, f)
end

Jac_I,Jac_J = SolverInterface.jac_structure(d)
Jac_I,Jac_J = numConstr > 0 ? SolverInterface.jac_structure(d) : (Int[], Int[])
Jac_val = zeros(length(Jac_I))
g_vec = zeros(numConstr)

Expand Down

0 comments on commit 547915c

Please sign in to comment.