Skip to content

Commit 281ddc8

Browse files
test: make optimization sparse hessian test independent of variable order
1 parent 1864663 commit 281ddc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/optimizationsystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ end
398398
sys = complete(sys)
399399
prob = OptimizationProblem(sys, [x => [42.0, 12.37]]; hess = true, sparse = true)
400400

401-
symbolic_hess = Symbolics.hessian(cost(sys), x)
401+
symbolic_hess = Symbolics.hessian(cost(sys), unknowns(sys))
402402
symbolic_hess_value = Symbolics.fast_substitute(symbolic_hess, Dict(x[1] => prob[x[1]], x[2] => prob[x[2]]))
403403

404404
oop_hess = prob.f.hess(prob.u0, prob.p)

0 commit comments

Comments
 (0)