Add numerical tests for BFGS and CG