Skip to main content

newton_system_2

Function newton_system_2 

Source
pub fn newton_system_2<F>(
    f: F,
    start: [f64; 2],
    criteria: Criteria,
) -> OgeomResult<([f64; 2], f64, Convergence, usize)>
where F: FnMut([f64; 2]) -> ([f64; 2], [[f64; 2]; 2]),
Expand description

A two-unknown newton_system, allocation-free.

The foot-point projection runs this system millions of times per real model, and the general path pays a heap allocation for every residual, Jacobian, vector and factorization of every damped step. The algorithm here is the same (damped Newton, halving until the residual falls, the same three convergence verdicts), with the two-by-two solve written out: partial pivoting is one comparison, and singularity is a vanishing pivot.

ยงErrors

OgeomError::Numeric if the Jacobian is singular.