This method is used in some of the optimization algorithms and provides a partial solution to the problem that many functionals are not defined on an entire vector space, but rather only on a subset. The evaluation object mechanism gives the functional class implementor a place to store these intermediate results so that they do not have to be re-computed if the the gradient is requested at some point after the value, for example. It does so by creating an evaluation object with the Evaluate method, getting the value from it, deleting the evaluation object, and returning the value. It does so by creating an evaluation object with the Evaluate method, getting the gradient from it, and deleting the evaluation object. It does so by creating an evaluation object with the Evaluate method, getting the Hessian from it, and deleting the evaluation object.
Scan computes the value of the function at N points.
This method is implemented in this class. This method computes the relative difference between the directional derivative as computed from the analytic gradient and the same estimated by a central difference formula. The parameters hmin, hmax, and n are optional and default to 0.1, 1.0, and 10, respectively. If the analytic gradient is correctly implemented and the function is three times continuously differentiable, then these errors will lie on a parabola when plotted against the step size. The results are sent to the output stream str.