Skip to main content

implicit_hessian

Function implicit_hessian 

Source
pub fn implicit_hessian<F: Float>(
    tape: &mut BytecodeTape<F>,
    z_star: &[F],
    x: &[F],
    num_states: usize,
) -> Option<Vec<Vec<Vec<F>>>>
Expand description

Compute the full implicit Hessian tensor d²z*/dx² (m × n × n).

Returns result[i][j][k] = ∂²z*_i / (∂x_j ∂x_k). The tensor is symmetric in the last two indices (j, k).

Cost: n(n+1)/2 nested Dual<Dual<F>> forward passes plus n(n+1)/2 back-solves, all sharing a single LU factorization of F_z.

Returns None if F_z is singular.