Struct Report
pub struct Report {
pub termination: Termination,
pub n_iter: usize,
pub n_residual_evals: usize,
pub n_jacobian_evals: usize,
pub cost: f64,
pub gradient_norm: f64,
pub cost_history: Vec<f64>,
pub gradient_norm_history: Vec<f64>,
pub params_history: Vec<Vec<f64>>,
}Expand description
Outcome of a solve. The optimised parameters live in the problem (read via
TrustRegionProblem::params); this only
carries diagnostics.
Not Copy: it carries the per-iteration convergence trajectory (cost_history
/ gradient_norm_history) as owned Vecs. These are observability only — they
do not affect the optimisation and are recorded once per accepted point plus the
terminal point.
Fields§
§termination: TerminationWhy the loop stopped.
n_iter: usizeAccepted iterations.
n_residual_evals: usizeResidual evaluations.
n_jacobian_evals: usizeJacobian evaluations.
cost: f64Final ½‖r‖².
gradient_norm: f64‖Jᵀr‖_∞ at the most recent point where the Jacobian was evaluated
— the start of the final outer iteration.
This is the definition for every termination reason, and it is what
makes the number comparable across them. It is deliberately not
“‖Jᵀr‖_∞ at the returned parameters”: on an Ftol/Xtol/MaxEval stop
the loop exits after accepting a step, and no Jacobian has been
evaluated at that new point, so reporting a gradient there would mean
either paying for an extra Jacobian evaluation or pairing the stale J
with the new r — a product that is the gradient at neither point. The
drivers therefore report the last genuinely-evaluated gradient instead.
On a Gtol stop the two coincide, since that test fires before any
step is taken.
cost_history: Vec<f64>½‖r‖² at each accepted point (index 0 = initial), ending at the terminal
cost. Empty only for an immediate pre-iteration numerical failure.
gradient_norm_history: Vec<f64>‖Jᵀr‖_∞ recorded alongside each cost_history entry, under the same
“at the most recent Jacobian evaluation” definition as
gradient_norm — so the terminal entry repeats
the previous iteration’s gradient when the loop stopped after an
accepted step.
params_history: Vec<Vec<f64>>The free-parameter vector θ at each accepted point, recorded alongside
each cost_history entry (same length and ordering). This is the raw
material for the convergence-to-truth metric dₖ = ‖(θₖ − θ_true)/s‖₂
on synthetic cases — observability only, it does not affect the solve.
Empty for solvers that do not track it (only the faer LM driver records
it today; the trust-region / dogleg / newton-cg drivers leave it empty).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Report
impl RefUnwindSafe for Report
impl Send for Report
impl Sync for Report
impl Unpin for Report
impl UnsafeUnpin for Report
impl UnwindSafe for Report
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more