Improve the error handling in Conjugte Gradients.

Due to floating point and conditioning issues, a system
matrix which is guaranteed to be PSD in exact arithmetic
can appear indefinite to the ConjugateGradientsSolver.

Previously, x'Ax <= 0, the solver returned with numerical
failure. Which the trust region solver will treat as a failed
solve.

But, more general truncated Newton when they encounter indefiniteness
use the step computed till that point instead of declaring failure.

This changes does this and adds a bit more logging.

Change-Id: I0e0cc56ef7d856f1c54ac6d638327b8353039f70
1 file changed