Implement the objective function and Jacobian for the exact solver.
Implement the objective function and Jacobian for the exact solver.