The function of which to calculate the Hessian.
The point at which to calculate the Hessian.
A "characteristic scale" over which the function changes significantly. (optional)
A buffer of size at least n(n+1)/2, for storing the Hessian matrix. (optional)
// Above, we found the gradient of f(x,y) at the point p. // Finding the Hessian matrix is just as simple: auto h = hessian(&f, p);
Calculate the Hessian matrix of a function of several variables using a central-difference approximation.
This function stores its results in an n-by-n symmetric matrix, where n is the number of variables (i.e. the length of x). The function f is evaluated 1+2n$(SUP 2) times.