526526"""
527527 addinfo!(info, mpc::NonLinMPC) -> info
528528
529- For [`NonLinMPC`](@ref), add `:sol`, the custom nonlinear objective `:JE`, the custom
530- constraint `:gc`, and the various derivatives.
529+ For [`NonLinMPC`](@ref), add `:sol`, the custom nonlinear objective `:JE`, the nonlinear
530+ constraint vectors and the various derivatives.
531531"""
532532function addinfo! (info, mpc:: NonLinMPC{NT} ) where NT<: Real
533533 # --- variables specific to NonLinMPC ---
@@ -585,7 +585,7 @@ function addinfo!(info, mpc::NonLinMPC{NT}) where NT<:Real
585585 update_predictions! (ΔŨ, x̂0end, Ue, Ŷe, U0, Ŷ0, Û0, K0, X̂0, gc, g, geq, mpc, Z̃)
586586 return nothing
587587 end
588- ∇g = jacobian (g!, g, mpc. jacobian, mpc. Z̃, ∇g_cache... )
588+ g, ∇g = value_and_jacobian (g!, g, mpc. jacobian, mpc. Z̃, ∇g_cache... )
589589 if ! isnothing (mpc. hessian) && any (old_i_g)
590590 @warn (
591591 " Retrieving optimal Hessian of the Lagrangian is not fully supported yet.\n " *
@@ -618,7 +618,7 @@ function addinfo!(info, mpc::NonLinMPC{NT}) where NT<:Real
618618 update_predictions! (ΔŨ, x̂0end, Ue, Ŷe, U0, Ŷ0, Û0, K0, X̂0, gc, g, geq, mpc, Z̃)
619619 return nothing
620620 end
621- ∇geq = jacobian (geq!, geq, mpc. jacobian, mpc. Z̃, geq_cache... )
621+ geq, ∇geq = value_and_jacobian (geq!, geq, mpc. jacobian, mpc. Z̃, geq_cache... )
622622 if ! isnothing (mpc. hessian) && con. neq > 0
623623 @warn (
624624 " Retrieving optimal Hessian of the Lagrangian is not fully supported yet.\n " *
@@ -642,8 +642,10 @@ function addinfo!(info, mpc::NonLinMPC{NT}) where NT<:Real
642642 end
643643 info[:∇J ] = ∇J
644644 info[:∇²J ] = ∇²J
645+ info[:g ] = g
645646 info[:∇g ] = ∇g
646647 info[:∇²ℓg ] = ∇²ℓg
648+ info[:geq ] = geq
647649 info[:∇geq ] = ∇geq
648650 info[:∇²ℓgeq ] = ∇²ℓgeq
649651 # --- non-Unicode fields ---
0 commit comments