Skip to content

Commit

Permalink
Optimize hessian_structure function for quadratic constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed May 12, 2022
1 parent 5585072 commit 6286c3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/moi_nlp_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,10 @@ function NLPModels.hess_structure!(
end
end
if nlp.quadcon.nquad > 0
quad_nnzh = nlp.quadcon.nnzh
hrows, hcols = hessian_structure(nlp.quadcon.set)
rows[(1 + nlp.obj.nnzh):(nlp.obj.nnzh + quad_nnzh)] .= hrows
cols[(1 + nlp.obj.nnzh):(nlp.obj.nnzh + quad_nnzh)] .= hcols
for (index, tuple) in enumerate(nlp.quadcon.set)
rows[nlp.obj.nnzh + index] = tuple[1]
cols[nlp.obj.nnzh + index] = tuple[2]
end
end
if (nlp.obj.type == "NONLINEAR") || (nlp.meta.nnln > nlp.quadcon.nquad)
hesslag_struct = MOI.hessian_lagrangian_structure(nlp.eval)
Expand Down

0 comments on commit 6286c3d

Please sign in to comment.