Skip to content

Commit ef14de6

Browse files
format
1 parent c484844 commit ef14de6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/function/mtk.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@ AutoModelingToolkit() = AutoModelingToolkit(false, false)
88
function instantiate_function(f, x, adtype::AutoModelingToolkit, p, num_cons = 0)
99
p = isnothing(p) ? SciMLBase.NullParameters() : p
1010

11-
sys = ModelingToolkit.modelingtoolkitize(OptimizationProblem(f, x, p; lcons = fill(0.0, num_cons), ucons = fill(0.0, num_cons)))
11+
sys = ModelingToolkit.modelingtoolkitize(OptimizationProblem(f, x, p;
12+
lcons = fill(0.0,
13+
num_cons),
14+
ucons = fill(0.0,
15+
num_cons)))
1216
sys = ModelingToolkit.structural_simplify(sys)
13-
f = OptimizationProblem(sys, x, p, grad = true, hess = true, obj_sparse = adtype.obj_sparse, cons_j = true, cons_h = true, cons_sparse = adtype.cons_sparse).f
17+
f = OptimizationProblem(sys, x, p, grad = true, hess = true,
18+
obj_sparse = adtype.obj_sparse, cons_j = true, cons_h = true,
19+
cons_sparse = adtype.cons_sparse).f
1420

1521
grad = (G, θ, args...) -> f.grad(G, θ, p, args...)
1622

0 commit comments

Comments
 (0)