Skip to main content

spectrafit_dogleg/
driver.rs

1//! The dogleg solver entry point.
2//!
3//! A thin wrapper that drives the framework's generic Δ-radius trust-region loop
4//! ([`minimize_tr`]) with the [`DoglegStep`] subproblem solver. All trust-region
5//! bookkeeping (Δ updates, gain-ratio acceptance, Moré scaling, termination)
6//! lives in the framework; this crate contributes only the step.
7
8use spectrafit_trust_region::{minimize_tr, Report, TrustRegionConfig, TrustRegionProblem};
9
10use crate::step::DoglegStep;
11
12/// Minimise `½‖r(p)‖²` over the free parameters of `problem` with Powell's
13/// dogleg trust-region method. On return the problem holds the best parameters.
14pub fn minimize<P: TrustRegionProblem>(problem: &mut P, cfg: &TrustRegionConfig) -> Report {
15    minimize_tr(problem, &DoglegStep, cfg)
16}