Skip to main content

Crate spectrafit_trust_region

Crate spectrafit_trust_region 

Source
Expand description

spectrafit-trust-region — a faer-native, graph-agnostic trust-region framework.

This crate owns the shared contract and vocabulary of nonlinear least-squares fitting so that every solver method in the workspace (spectrafit-levenberg-marquardt, and the planned dogleg / Newton-CG crates) builds on one tested foundation, pure-Rust SIMD via faer with no BLAS/C dependency.

§Design

  • TrustRegionProblem is the only coupling point: an implementor supplies weighted residuals and a weighted Jacobian written into caller-owned faer buffers (plus matrix-free J·v / Jᵀ·u operators for Krylov methods), and applies any parameter-space projection (bounds reflection, expression-tied parameters) in TrustRegionProblem::set_params.
  • Report / Termination are the generic outcome types every method reports, so consumers speak one vocabulary regardless of which method ran.

Each concrete method (its outer control loop and step computation) lives in its own crate on top of this framework — e.g. the LM / TRF / geodesic loop is in spectrafit-levenberg-marquardt. The framework depends only on spectrafit-types (for CoreError) and faer, so it sits as a leaf next to spectrafit-types in the workspace DAG.

Structs§

Report
Outcome of a solve. The optimised parameters live in the problem (read via TrustRegionProblem::params); this only carries diagnostics.
StepResult
A scaled step produced by a SubproblemStep.
Subproblem
The trust-region subproblem at one outer iteration, in scaled coordinates.
TrustRegionConfig
Tuning for a single Δ-radius trust-region solve.

Enums§

Termination
Why the solve stopped.

Traits§

SubproblemStep
A trust-region subproblem solver: minimise the local quadratic model within the scaled radius Δ. One implementation per method (dogleg, Steihaug-CG).
TrustRegionProblem
A weighted nonlinear least-squares problem driven by the trust-region core.

Functions§

minimize_tr
Minimise ½‖r(p)‖² over the free parameters of problem with an explicit Δ-radius trust region, delegating the per-iteration subproblem to step.