Added a check for an infinite target function value to the main optimisation loop.
This is to prevent the problem that certain optimisation algorithms will continue indefinitely when infinite target function values are encountered.
Authored by: bugman 2014-09-11
Parent: [r175]
Child: [r177]