pub fn newton_krylov<F>(
f: F,
x0: &[f64],
preconditioner: Option<&dyn LinearOperator>,
options: &NewtonKrylovOptions,
) -> Result<NewtonKrylovResult, ErrorsJSL>Expand description
Solves F(x) = 0 for large n without forming the Jacobian (SciPy’s newton_krylov). Each
Newton iteration solves J dx = −F(x) inexactly with a Krylov method, to the relative
accuracy η of the Eisenstat-Walker forcing sequence (choice 2, γ = 0.9), using finite-
difference products J v; an Armijo line search on ‖F‖² then sets the step. An optional
preconditioner M ≈ J⁻¹ (SciPy’s inner_M) applies to the inner solves.