Speed ups for the optimisation tests in the test suite.
The grid search of each optimisation algorithm test has been replaced by the value setting function
as the results of the grid search are the same for each of the tests. As the grid search is
computationally expensive, this significantly speeds up the tests.