@@ -5,16 +5,16 @@ struct AnalysisResults{O, C}
55 constraints:: C
66end
77
8- struct OptimizationCache{F, RC, LB, UB, LC, UC, S, O , P, C, M} < :
8+ struct OptimizationCache{O, F, RC, LB, UB, LC, UC, S, P, C, M} < :
99 SciMLBase. AbstractOptimizationCache
10+ opt:: O
1011 f:: F
1112 reinit_cache:: RC
1213 lb:: LB
1314 ub:: UB
1415 lcons:: LC
1516 ucons:: UC
1617 sense:: S
17- opt:: O
1818 progress:: P
1919 callback:: C
2020 manifold:: M
@@ -46,13 +46,13 @@ function OptimizationCache(prob::SciMLBase.OptimizationProblem, opt;
4646 prob. f. adtype isa AutoZygote) &&
4747 (SciMLBase. requireshessian (opt) || SciMLBase. requiresconshess (opt) ||
4848 SciMLBase. requireslagh (opt))
49- @warn " The selected optimization algorithm requires second order derivatives, but `SecondOrder` ADtype was not provided.
50- So a `SecondOrder` with $(prob. f. adtype) for both inner and outer will be created, this can be suboptimal and not work in some cases so
49+ @warn " The selected optimization algorithm requires second order derivatives, but `SecondOrder` ADtype was not provided.
50+ So a `SecondOrder` with $(prob. f. adtype) for both inner and outer will be created, this can be suboptimal and not work in some cases so
5151 an explicit `SecondOrder` ADtype is recommended."
5252 elseif prob. f. adtype isa AutoZygote &&
5353 (SciMLBase. requiresconshess (opt) || SciMLBase. requireslagh (opt) ||
5454 SciMLBase. requireshessian (opt))
55- @warn " The selected optimization algorithm requires second order derivatives, but `AutoZygote` ADtype was provided.
55+ @warn " The selected optimization algorithm requires second order derivatives, but `AutoZygote` ADtype was provided.
5656 So a `SecondOrder` with `AutoZygote` for inner and `AutoForwardDiff` for outer will be created, for choosing another pair
5757 an explicit `SecondOrder` ADtype is recommended."
5858 end
@@ -71,9 +71,9 @@ function OptimizationCache(prob::SciMLBase.OptimizationProblem, opt;
7171 cons_res = nothing
7272 end
7373
74- return OptimizationCache (f, reinit_cache_passedon, prob. lb, prob. ub, prob. lcons,
74+ return OptimizationCache (opt, f, reinit_cache_passedon, prob. lb, prob. ub, prob. lcons,
7575 prob. ucons, prob. sense,
76- opt, progress, callback, manifold, AnalysisResults (obj_res, cons_res),
76+ progress, callback, manifold, AnalysisResults (obj_res, cons_res),
7777 merge ((; maxiters, maxtime, abstol, reltol),
7878 NamedTuple (kwargs)))
7979end
0 commit comments