spectrafit_newton_cg/driver.rs
1//! The Newton-CG (Steihaug) solver entry point.
2//!
3//! A thin wrapper driving the framework's generic Δ-radius trust-region loop
4//! ([`minimize_tr`]) with the matrix-free [`SteihaugStep`] subproblem solver.
5
6use spectrafit_trust_region::{minimize_tr, Report, TrustRegionConfig, TrustRegionProblem};
7
8use crate::step::SteihaugStep;
9
10/// Minimise `½‖r(p)‖²` over the free parameters of `problem` with the matrix-free
11/// Newton-CG (Steihaug–Toint) trust-region method. On return the problem holds
12/// the best parameters.
13pub fn minimize<P: TrustRegionProblem>(problem: &mut P, cfg: &TrustRegionConfig) -> Report {
14 minimize_tr(problem, &SteihaugStep, cfg)
15}