Finish implementing the Nonlinear Conjugate Gradient

Now everything is prepared for the pull request.