pub fn numerical_gradient<T, F>(
f: &F,
x: &[T],
h: T,
mode: DifferenceMode,
) -> CoreResult<Array1<T>>Expand description
Compute the numerical gradient of a scalar function at point x.
f– function from R^n -> R, taking a slice and returning a scalar.x– the point at which to evaluate the gradient.h– step size (e.g. 1e-5).mode– finite difference mode.
Returns an Array1<T> of the same length as x.