Skip to main content

SolveStatistics

Struct SolveStatistics 

Source
pub struct SolveStatistics {
Show 28 fields pub iteration_count: i32, pub total_cpu_time_secs: f64, pub total_sys_time_secs: f64, pub total_wallclock_time_secs: f64, pub num_obj_evals: i32, pub num_constr_evals: i32, pub num_obj_grad_evals: i32, pub num_constr_jac_evals: i32, pub num_hess_evals: i32, pub final_objective: f64, pub final_scaled_objective: f64, pub final_dual_inf: f64, pub final_constr_viol: f64, pub final_compl: f64, pub final_kkt_error: f64, pub final_unscaled_dual_inf: f64, pub final_unscaled_constr_viol: f64, pub final_unscaled_compl: f64, pub final_unscaled_kkt_error: f64, pub final_kkt_error_above_noise: f64, pub final_mu: f64, pub restoration_calls: i32, pub restoration_inner_iters: i32, pub restoration_outer_iters: i32, pub restoration_wall_secs: f64, pub sqp_qp_solves: i32, pub sqp_qp_working_set_changes: i32, pub iterations: Vec<IterRecord>,
}

Fields§

§iteration_count: i32§total_cpu_time_secs: f64§total_sys_time_secs: f64§total_wallclock_time_secs: f64§num_obj_evals: i32§num_constr_evals: i32§num_obj_grad_evals: i32§num_constr_jac_evals: i32§num_hess_evals: i32§final_objective: f64§final_scaled_objective: f64§final_dual_inf: f64§final_constr_viol: f64§final_compl: f64§final_kkt_error: f64§final_unscaled_dual_inf: f64§final_unscaled_constr_viol: f64§final_unscaled_compl: f64§final_unscaled_kkt_error: f64§final_kkt_error_above_noise: f64

final_kkt_error with each constraint row’s residual counted only where it rises above what that row can represent in floating point — the aggregate the strict convergence gate actually tests (gh #528). Equal to final_kkt_error on every problem whose data is O(1), and smaller only where a row is at its own resolution limit. Reported so a summary that ends EXIT: Optimal Solution Found beside an error above tol accounts for the gap rather than merely presenting it.

§final_mu: f64

Final barrier parameter μ at termination (the IPM’s curr_mu after the last iterate). Lets a caller thread the converged barrier into a warm-started re-solve’s mu_init / warm_start_target_mu for predictor–corrector path following (pounce#86). 0.0 on the barrier-free SQP path, where μ has no meaning.

§restoration_calls: i32

Number of times IpoptAlgorithm::invoke_restoration was entered during this solve.

§restoration_inner_iters: i32

Cumulative inner-IPM iteration count across every restoration call (sum of RestoSolveResult::iter_count). Each restoration call’s inner IPM runs to its own convergence; this is the total work the inner solver did.

§restoration_outer_iters: i32

Number of outer iterations that ran in restoration mode (the r-suffix iter lines visible in print_level=5 output). Counts outer iters where the IPM was driving a restoration trial step rather than a normal Newton step.

§restoration_wall_secs: f64

Cumulative wall-clock seconds spent inside perform_restoration across all restoration calls. Useful for “what fraction of the solve was restoration?” without running with high print_level.

§sqp_qp_solves: i32

Number of QP subproblems solved during this solve.

§sqp_qp_working_set_changes: i32

Active-set changes (adds + drops) summed over those QP subproblems. This is the measurement a working-set warm start is judged on: the outer iteration count can be identical between a cold and a warm solve while this differs by an order of magnitude, and on a QP-shaped NLP (one outer iteration by construction) it is the only thing that moves at all.

§iterations: Vec<IterRecord>

Per-iteration trajectory. Empty when the consumer doesn’t ask for it (iter_history_enabled = false on the application or the binary’s --json-detail summary mode). Populated in order by [IpoptAlgorithm::iterate] when enabled.

Implementations§

Trait Implementations§

Source§

impl Clone for SolveStatistics

Source§

fn clone(&self) -> SolveStatistics

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 SolveStatistics

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for SolveStatistics

The eight residual fields default to NaN, not zero.

They are populated by the convergence check at the end of a solve. A solve that never gets that far – rejected during setup (Not_Enough_Degrees_Of_Freedom, Invalid_Problem_Definition), aborted, or caught by the batch panic handler – leaves them untouched, and a default of 0.0 there reads as “converged perfectly” rather than “never computed”.

That is not hypothetical. pounce.minimize upgrades a non-success status to success=True when the final KKT error is within the acceptable tolerance, which is right for a solve that stalled near a good point. With a zero default it also fired for problems the solver had refused: an over-determined NLP returned Not_Enough_Degrees_Of_Freedom together with success=True and an x outside its own variable bounds. NaN makes the existing is_finite guard on that path do what its comment already claims.

Consequences worth knowing:

  • NaN compares false against everything, so any residual <= tol test now fails closed for an uncomputed value. That is the intent.
  • serde_json renders non-finite floats as null, so these fields appear as null rather than 0.0 in a solve report for an aborted solve. See docs/src/schema/solve-report-v1.md.

The two objective fields are in the set for the same reason, though the stakes are lower: nothing decides anything from them, they are only reported (console summary, studio markdown, the JSON report). But 0.0 is a perfectly ordinary objective value, so a reader cannot tell a solve that legitimately reached zero from one that never evaluated anything. One rule – uncomputed is NaN – is easier to reason about than “residuals are NaN, objectives are zero, and you have to remember which is which”. Note they are seeded best-effort from the current iterate whenever one exists, so they are only NaN when the solve died before producing any point at all.

final_mu is deliberately not in this set: 0.0 is its documented value on the barrier-free SQP path, where mu has no meaning.

Source§

fn default() -> SolveStatistics

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for SolveStatistics

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<SolveStatistics, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SolveStatistics

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more