approximate_jacobian_fd

Function approximate_jacobian_fd 

Source
pub fn approximate_jacobian_fd<'a, T>(
    m: usize,
    f: impl FnMut(DVectorView<'_, T>, DVectorViewMut<'_, T>),
    x: impl Into<DVectorViewMut<'a, T>>,
    h: T,
) -> DMatrix<T>
where T: Real,
Expand description

Approximates the Jacobian of the function $f: \mathbb{R}^n \rightarrow \mathbb{R}^m$ with finite differences.

The Jacobian matrix is the $m \times n$ matrix whose entries are given by $$ J_{ij} := \pd{f_i}{x_j}.$$

The parameter h determines the step size of the finite difference approximation.