Skip to main content

forward_difference_hessian

Function forward_difference_hessian 

Source
pub fn forward_difference_hessian<P, V>(
    problem: &P,
    x: &V,
    function_precision: f64,
    fixed_step: Option<f64>,
) -> Result<<V as DenseMatrixFromFn>::Matrix, P::Error>
where P: CostFunction<Param = V, Output = f64> + MaybeSync, V: Clone + VectorLen + VectorIndex + DenseMatrixFromFn + MaybeSync, P::Error: MaybeSend,
Expand description

Forward-difference Hessian (one-sided second differences).

Hᵢⱼ = (f(x+hᵢeᵢ+hⱼeⱼ) − f(x+hᵢeᵢ) − f(x+hⱼeⱼ) + f(x)) / hᵢhⱼ, with the diagonal as the i = j case (f(x+2hᵢeᵢ)). Symmetric n × n by construction; 1 + n + n(n+1)/2 cost evaluations. Returns Err if any probe’s cost does.