@@ -583,9 +583,9 @@ function get_optim_functions(mpc::NonLinMPC, ::JuMP.GenericModel{JNT}) where JNT
583583 )
584584 ∇J_prep = prepare_gradient (Jfunc!, grad, Z̃_∇J, ∇J_context... ; strict)
585585 ∇J = Vector {JNT} (undef, nZ̃)
586- function update_objective! (J, ∇J, Z̃ , Z̃arg)
587- if isdifferent (Z̃arg, Z̃ )
588- Z̃ .= Z̃arg
586+ function update_objective! (J, ∇J, Z̃_∇J , Z̃arg)
587+ if isdifferent (Z̃arg, Z̃_∇J )
588+ Z̃_∇J .= Z̃arg
589589 J[], _ = value_and_gradient! (Jfunc!, ∇J, ∇J_prep, grad, Z̃_∇J, ∇J_context... )
590590 end
591591 end
@@ -620,10 +620,10 @@ function get_optim_functions(mpc::NonLinMPC, ::JuMP.GenericModel{JNT}) where JNT
620620 ∇g_prep = prepare_jacobian (gfunc!, g, jac, Z̃_∇g, ∇g_context... ; strict)
621621 mpc. con. i_g[1 : end - nc] .= false
622622 ∇g = init_diffmat (JNT, jac, ∇g_prep, nZ̃, ng)
623- function update_con! (g, ∇g, Z̃ , Z̃arg)
624- if isdifferent (Z̃arg, Z̃ )
625- Z̃ .= Z̃arg
626- value_and_jacobian! (gfunc!, g, ∇g, ∇g_prep, jac, Z̃ , ∇g_context... )
623+ function update_con! (g, ∇g, Z̃_∇g , Z̃arg)
624+ if isdifferent (Z̃arg, Z̃_∇g )
625+ Z̃_∇g .= Z̃arg
626+ value_and_jacobian! (gfunc!, g, ∇g, ∇g_prep, jac, Z̃_∇g , ∇g_context... )
627627 end
628628 end
629629 gfuncs = Vector {Function} (undef, ng)
@@ -662,10 +662,10 @@ function get_optim_functions(mpc::NonLinMPC, ::JuMP.GenericModel{JNT}) where JNT
662662 )
663663 ∇geq_prep = prepare_jacobian (geqfunc!, geq, jac, Z̃_∇geq, ∇geq_context... ; strict)
664664 ∇geq = init_diffmat (JNT, jac, ∇geq_prep, nZ̃, neq)
665- function update_con_eq! (geq, ∇geq, Z̃ , Z̃arg)
666- if isdifferent (Z̃arg, Z̃ )
667- Z̃ .= Z̃arg
668- value_and_jacobian! (geqfunc!, geq, ∇geq, ∇geq_prep, jac, Z̃ , ∇geq_context... )
665+ function update_con_eq! (geq, ∇geq, Z̃_∇geq , Z̃arg)
666+ if isdifferent (Z̃arg, Z̃_∇geq )
667+ Z̃_∇geq .= Z̃arg
668+ value_and_jacobian! (geqfunc!, geq, ∇geq, ∇geq_prep, jac, Z̃_∇geq , ∇geq_context... )
669669 end
670670 end
671671 geqfuncs = Vector {Function} (undef, neq)
0 commit comments