pub fn reconstruct_hessian_central_diff(
gradients_forward: &ArrayView2<'_, f64>,
gradients_backward: &ArrayView2<'_, f64>,
p: &ArrayView2<'_, f64>,
sparsity: &CsrArray<f64>,
h: f64,
) -> Result<CsrArray<f64>, OptimizeError>
Expand description
Reconstructs a sparse Hessian from compressed gradient evaluations using central differences
Takes compressed gradient evaluations and reconstructs the symmetric sparse Hessian. The reconstruction assumes that gradients were computed using central differences with the compressed perturbation vectors.
§Arguments
gradients_forward
- Forward difference gradients (n x num_colors)gradients_backward
- Backward difference gradients (n x num_colors)p
- Compression matrix (n x num_colors)sparsity
- Original Hessian sparsity patternh
- Step size used in finite differences
§Returns
- Reconstructed sparse Hessian