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
Fix Lagrangian Hessian prototype dimensions in OptimizationZygoteExt
The Lagrangian Hessian prototype was incorrectly sized as (num_constraints × num_variables)
instead of (num_variables × num_variables). This caused a `BoundsError` when computing the
Lagrangian Hessian with more variables than constraints, as the prototype was used as a
buffer for the n×n Hessian matrix.
Changes:
- Fix lag_hess_prototype initialization to use zeros(Bool, length(x), length(x))
- Add comprehensive tests to verify prototype dimensions and usability as a buffer
This ensures the Lagrangian Hessian is always correctly sized as n×n regardless of the
number of constraints, matching the mathematical definition of the Lagrangian Hessian
as the second derivative with respect to the decision variables.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments