You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add cons_h_weighted! to handle σ=0 in Lagrangian Hessian
When computing the Lagrangian Hessian with lag_h!, the case σ=0 requires
special handling since it reduces to just the weighted sum of constraint
Hessians (Σᵢ λᵢ∇²cᵢ) without the objective contribution.
Previously, this case would fail when cons_h was not explicitly requested
but lag_h was, because the constraint Hessian preparations were not created.
This commit:
- Always creates constraint Hessian preparations when either cons_h or lag_h is true
- Adds cons_h_weighted!(H, θ, λ) function to compute the weighted sum directly into H
- Updates lag_h! to use cons_h_weighted! when σ=0
This fixes the edge case in OptimizationMadNLP where the solver could hit
σ=0 during iterations, particularly with exact Hessian and sparse KKT systems.
Applies to both OptimizationDIExt and OptimizationZygoteExt.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
0 commit comments