@@ -260,9 +260,14 @@ optprob.cons_h(H3, x0)
260
260
G2 = Array {Float64} (undef, 2 )
261
261
H2 = Array {Float64} (undef, 2 , 2 )
262
262
263
- optf = OptimizationFunction (rosenbrock, DifferentiationInterface. SecondOrder (ADTypes. AutoFiniteDiff (), ADTypes. AutoReverseDiff ()), cons = cons)
263
+ optf = OptimizationFunction (rosenbrock,
264
+ DifferentiationInterface. SecondOrder (
265
+ ADTypes. AutoFiniteDiff (), ADTypes. AutoReverseDiff ()),
266
+ cons = cons)
264
267
optprob = OptimizationBase. instantiate_function (
265
- optf, x0, DifferentiationInterface. SecondOrder (ADTypes. AutoFiniteDiff (), ADTypes. AutoReverseDiff ()),
268
+ optf, x0,
269
+ DifferentiationInterface. SecondOrder (
270
+ ADTypes. AutoFiniteDiff (), ADTypes. AutoReverseDiff ()),
266
271
nothing , 1 , g = true , h = true , hv = true ,
267
272
cons_j = true , cons_h = true , cons_vjp = true ,
268
273
cons_jvp = true , lag_h = true )
489
494
H2 = Array {Float64} (undef, 2 , 2 )
490
495
491
496
optf = OptimizationFunction (
492
- rosenbrock, DifferentiationInterface. SecondOrder (ADTypes. AutoFiniteDiff (), ADTypes. AutoReverseDiff ()), cons = con2_c)
497
+ rosenbrock, DifferentiationInterface. SecondOrder (
498
+ ADTypes. AutoFiniteDiff (), ADTypes. AutoReverseDiff ()),
499
+ cons = con2_c)
493
500
optprob = OptimizationBase. instantiate_function (
494
- optf, x0, DifferentiationInterface. SecondOrder (ADTypes. AutoFiniteDiff (), ADTypes. AutoReverseDiff ()),
501
+ optf, x0,
502
+ DifferentiationInterface. SecondOrder (
503
+ ADTypes. AutoFiniteDiff (), ADTypes. AutoReverseDiff ()),
495
504
nothing , 2 , g = true , h = true , hv = true ,
496
505
cons_j = true , cons_h = true , cons_vjp = true ,
497
506
cons_jvp = true , lag_h = true )
@@ -737,12 +746,15 @@ end
737
746
@test lag_H ≈ lag_H_expected
738
747
@test nnz (lag_H) == 5
739
748
740
- optf = OptimizationFunction (sparse_objective, AutoSparse (DifferentiationInterface. SecondOrder (ADTypes. AutoForwardDiff (), ADTypes. AutoZygote ())),
749
+ optf = OptimizationFunction (sparse_objective,
750
+ AutoSparse (DifferentiationInterface. SecondOrder (
751
+ ADTypes. AutoForwardDiff (), ADTypes. AutoZygote ())),
741
752
cons = sparse_constraints)
742
753
743
754
# Instantiate the optimization problem
744
755
optprob = OptimizationBase. instantiate_function (optf, x0,
745
- AutoSparse (DifferentiationInterface. SecondOrder (ADTypes. AutoForwardDiff (), ADTypes. AutoZygote ())),
756
+ AutoSparse (DifferentiationInterface. SecondOrder (
757
+ ADTypes. AutoForwardDiff (), ADTypes. AutoZygote ())),
746
758
nothing , 2 , g = true , h = true , cons_j = true , cons_h = true , lag_h = true )
747
759
# Test gradient
748
760
G = zeros (3 )
0 commit comments