parallel_sparse_jacobian

Function parallel_sparse_jacobian 

Source
pub fn parallel_sparse_jacobian<F, Func>(
    f: &Func,
    t: F,
    y: &Array1<F>,
    f_current: &Array1<F>,
    sparsity_pattern: Option<&Array2<bool>>,
    perturbation_scale: F,
) -> IntegrateResult<Array2<F>>
where F: IntegrateFloat + Send + Sync, Func: Fn(F, ArrayView1<'_, F>) -> Array1<F> + Sync,
Expand description

Compute sparse Jacobian matrix in parallel using coloring

This function uses graph coloring to identify independent columns of the Jacobian that can be computed simultaneously, reducing the number of function evaluations needed for sparse Jacobians.

§Arguments

  • f - Function to differentiate
  • t - Time value
  • y - State vector
  • f_current - Current function evaluation at (t, y)
  • sparsity_pattern - Optional sparsity pattern (true for non-zero entries)
  • perturbation_scale - Scaling factor for perturbation size

§Returns

Jacobian matrix (∂f/∂y)

§Features

Requires the “parallel_jacobian” feature to be enabled for actual parallel execution. Falls back to a serial implementation if the feature is not enabled.