Skip to content

Commit

Permalink
Merge pull request #698 from JuliaOpt/ml/hessvec
Browse files Browse the repository at this point in the history
overwrite input vector for hesslag_prod
  • Loading branch information
mlubin committed Mar 9, 2016
2 parents 67a365b + 5ee953c commit dde5e9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/nlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,8 @@ function MathProgBase.eval_hesslag_prod(
reverse_eval_all(d,x)
end

fill!(h, 0.0)

# quadratic objective
qobj::QuadExpr = d.m.obj
for k in 1:length(qobj.qvars1)
Expand Down
2 changes: 1 addition & 1 deletion test/nonlinear.jl
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ facts("[nonlinear] Hess-vec through MPB") do
@addNLConstraint(m, a^2/2 <= 1)
d = JuMPNLPEvaluator(m)
MathProgBase.initialize(d, [:HessVec])
h = zeros(3)
h = ones(3) # test that input values are overwritten
v = [2.4,3.5,1.2]
MathProgBase.eval_hesslag_prod(d, h, m.colVal, v, 1.0, [2.0,3.0])
correct = [3.0 1.0 0.0; 1.0 0.0 2.0; 0.0 2.0 2.0]*v
Expand Down

0 comments on commit dde5e9f

Please sign in to comment.