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>>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 differentiatet- Time valuey- State vectorf_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.