Search stays in p. Trial and accepted gradients are adjoint evaluations
on restored states. Does not call the public unconstrained bfgs.
Supports both cost functions f(p,x) and residual functions r(p,x) where f = 1/2 r^T r.
For small-residual least squares, prefer constrained Gauss–Newton / LM.
Performs reduced-space BFGS on f̃(p)=f(p,x(p)).
Search stays in p. Trial and accepted gradients are adjoint evaluations on restored states. Does not call the public unconstrained
bfgs.Supports both cost functions f(p,x) and residual functions r(p,x) where f = 1/2 r^T r. For small-residual least squares, prefer constrained Gauss–Newton / LM.