Skip to main content

Report

Struct Report 

Source
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: Termination

Why the loop stopped.

§n_iter: usize

Accepted iterations.

§n_residual_evals: usize

Residual evaluations.

§n_jacobian_evals: usize

Jacobian evaluations.

§cost: f64

Final ½‖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§

Source§

impl Clone for Report

Source§

fn clone(&self) -> Report

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Report

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> DistributionExt for T
where T: ?Sized,

§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V