lnsrch function

Search along a line for a minimum within an optimisation algorithm.