Skip to content

Commit 4a4158c

Browse files
Merge pull request #4003 from SciML/as/minor-test-fix
test: make optimization sparse hessian test independent of variable order
2 parents 1864663 + 281ddc8 commit 4a4158c

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)