A quadratically approximate framework for constrained optimization, global and local convergence