Skip to main content

spectrafit_levenberg_marquardt/
lib.rs

1//! spectrafit-levenberg-marquardt — the Levenberg–Marquardt family of solvers.
2//!
3//! This crate is one *method* on the graph-agnostic
4//! [`spectrafit-trust-region`](spectrafit_trust_region) framework: it owns the
5//! classic LM outer loop (Nielsen `λ/ν` damping, gain-ratio acceptance, Moré
6//! column scaling) and the regime-adaptive damped Gauss–Newton step
7//! (normal-equations + Cholesky, or thin-SVD secular), and layers two opt-in
8//! variants on the same loop:
9//!
10//! * **TRF** — Coleman–Li bound scaling folded into the damping
11//!   ([`StrategyConfig::bound_scaling`]).
12//! * **geodesic** — Transtrum/Sethna second-order acceleration
13//!   ([`StrategyConfig::geodesic`]).
14//!
15//! The shared problem contract ([`TrustRegionProblem`]) and outcome types
16//! ([`Report`], [`Termination`]) live in the framework crate and are re-exported
17//! here, so a consumer needs only a `spectrafit-levenberg-marquardt` dependency
18//! for the full LM API surface.
19#![warn(missing_docs)]
20
21mod driver;
22mod error;
23mod problem;
24mod step;
25
26pub use driver::{minimize, StrategyConfig};
27pub use error::StepError;
28pub use problem::TrustRegionProblem;
29pub use step::{factorize, select_regime, StepFactor, StepKind, StepOutput};
30
31// Re-export the framework outcome types so downstream consumers depend only on
32// this crate for the full LM API surface.
33pub use spectrafit_trust_region::{Report, Termination};
34
35#[cfg(test)]
36mod tests;