Skip to main content

bfgs

Function bfgs 

Source
pub fn bfgs(
    f: impl Fn(&[f64]) -> f64,
    grad: impl Fn(&[f64]) -> Vec<f64>,
    x0: Vec<f64>,
    tol: f64,
    max_iter: usize,
) -> OptResult
Expand description

Full-memory BFGS (Broyden-Fletcher-Goldfarb-Shanno).

Maintains an approximate Hessian inverse H (n×n matrix) updated with each iteration. Falls back to gradient descent when curvature information is insufficient.