Skip to main content

OptErrorConvCheck

Struct OptErrorConvCheck 

Source
pub struct OptErrorConvCheck {
Show 23 fields pub tol: Number, pub dual_inf_tol: Number, pub constr_viol_tol: Number, pub compl_inf_tol: Number, pub acceptable_tol: Number, pub acceptable_dual_inf_tol: Number, pub acceptable_constr_viol_tol: Number, pub acceptable_compl_inf_tol: Number, pub acceptable_obj_change_tol: Number, pub acceptable_iter: Index, pub max_iter: Index, pub max_cpu_time: Number, pub max_wall_time: Number, pub acceptable_count: Index, pub last_acceptable_obj: Option<Number>, pub infeas_stationarity_tol: Number, pub infeas_viol_kappa: Number, pub infeas_max_streak: Index, pub infeas_streak: Index, pub obj_scale_certificate_threshold: Number, pub veto_fired: bool, pub acceptable_veto_fired: bool, pub veto_extra_iters: Index,
}

Fields§

§tol: Number§dual_inf_tol: Number§constr_viol_tol: Number§compl_inf_tol: Number§acceptable_tol: Number§acceptable_dual_inf_tol: Number§acceptable_constr_viol_tol: Number§acceptable_compl_inf_tol: Number§acceptable_obj_change_tol: Number§acceptable_iter: Index§max_iter: Index§max_cpu_time: Number§max_wall_time: Number§acceptable_count: Index§last_acceptable_obj: Option<Number>

Objective value at the last iterate the main loop stashed via set_curr_acceptable_obj. Used by the acceptable_obj_change_tol cross-check. None until an acceptable point has been recorded.

§infeas_stationarity_tol: Number

Tolerance on the scaled infeasibility stationarity ‖Jᵀc‖/max(1,‖c‖). An iterate counts toward the infeasibility streak when this ratio is at or below this value while the constraint violation stays bounded away from zero. Rapid infeasibility detection is disabled when this is non-positive.

§infeas_viol_kappa: Number

Multiple of constr_viol_tol the constraint violation must exceed before an iterate can count as infeasible-stationary — keeps detection from firing on nearly-feasible flat spots.

§infeas_max_streak: Index

Consecutive infeasible-stationary iterations required before terminating with LocallyInfeasible. Non-positive disables rapid infeasibility detection.

§infeas_streak: Index

Running count of consecutive infeasible-stationary iterations.

§obj_scale_certificate_threshold: Number

Objective-scale floor below which a strict certificate is refused while the unscaled KKT error is still above acceptable_tol (gh #200). See certificate_masked. 0 disables the mechanism entirely, restoring bit-for-bit upstream-Ipopt behaviour.

§veto_fired: bool

Whether a masked strict certificate was ever refused this solve.

§acceptable_veto_fired: bool

Whether a masked acceptable-level termination was ever refused.

Tracked separately because the two refusals must be undone differently: a refused strict certificate restores as Success, a refused acceptable-level one as StopAtAcceptablePoint. Conflating them would either over-claim a status or, as originally written, leave the acceptable-level refusal with no safety net at all.

§veto_extra_iters: Index

Iterations spent since the veto first refused a certificate.

The veto is a bet that continuing reaches a better point. Some problems never let it pay off — an unscaled error pinned above acceptable_tol by an unbounded direction keeps the veto engaged until max_iter, turning a 40-iteration solve into a 300-iteration one for nothing. Past [VETO_MAX_EXTRA_ITERS] the bet is called off and the run is allowed to terminate normally; correctness does not depend on the cap, because the refused certificate is restored either way.

Implementations§

Trait Implementations§

Source§

impl ConvCheck for OptErrorConvCheck

Source§

fn certificate_vetoed(&self) -> bool

State-aware convergence check. The main loop calls this on every iteration so policies that need access to the iterate (e.g. RestoConvCheckAdapter’s orig-NLP inf_pr evaluation for the kappa-reduction early-exit) can read data.curr and the cq layer. Default impl delegates to Self::check_convergence, so scalar-only policies don’t need to override. Whether this policy ever refused a termination certificate it judged masked by an extreme objective scale (gh #200). Read more
Source§

fn acceptable_certificate_vetoed(&self) -> bool

Whether this policy ever refused an acceptable-level termination it judged masked (gh #200). Undone differently from a strict refusal — see OptErrorConvCheck::acceptable_veto_fired.
Source§

fn check_convergence( &mut self, nlp_err: Number, iter_count: Index, ) -> ConvergenceStatus

Source§

fn check_convergence_with_state( &mut self, nlp_err: Number, iter_count: Index, data: &IpoptDataHandle, cq: &IpoptCqHandle, ) -> ConvergenceStatus

Source§

fn current_passes_strict( &self, nlp_err: Number, _data: &IpoptDataHandle, cq: &IpoptCqHandle, ) -> bool

Whether the current iterate passes the strict per-component convergence tolerances — the Self::check_convergence_with_state strict test with the masked-certificate veto (gh #200) removed. In other words: would this iterate have certified Success were it not for the objective-scale masking? Read more
Source§

fn tol_or_default(&self) -> Number

Outer NLP convergence tolerance, as used by the main loop’s almost-feasible bypass guard (port of IpBacktrackingLineSearch.cpp:580). Default 1e-8 matches upstream’s default tol.
Source§

fn acceptable_constr_viol_tol_or_default(&self) -> Number

Acceptable-level primal-feasibility band acceptable_constr_viol_tol, in the unscaled max-norm space curr_unscaled_primal_infeasibility_max reports. Read by the best-acceptable fallback’s feasibility-aware ranking (gh #267), which caps it at the upstream default so a user-widened band cannot let the fallback spend feasibility to buy objective. Default 1e-2 matches upstream’s default acceptable_constr_viol_tol; policies that track no such tolerance keep it.
Source§

fn set_tolerance(&mut self, name: &str, value: Number) -> bool

Live-update a named convergence tolerance mid-solve, for the debugger’s in-place option hot-swap. Returns true if name matched a tolerance this policy owns (so the caller can report whether it took). Default: this policy exposes no live tolerances → false.
Source§

fn current_is_acceptable(&self, nlp_err: Number) -> bool

Whether the supplied nlp_err is at or below the acceptable tolerance — port of upstream OptimalityErrorConvergenceCheck::CurrentIsAcceptable. Used by the main loop to gate StoreAcceptablePoint / RestoreAcceptablePoint. Default returns false so policies that don’t track an acceptable level (e.g. resto-of-resto inner adapters) silently skip the rollback machinery.
Source§

fn current_is_acceptable_with_state( &self, nlp_err: Number, _data: &IpoptDataHandle, cq: &IpoptCqHandle, ) -> bool

State-aware acceptance check. Mirrors upstream OptimalityErrorConvergenceCheck::CurrentIsAcceptable which reads the per-component residuals and current f to gate the acceptable_dual_inf_tol / acceptable_constr_viol_tol / acceptable_compl_inf_tol / acceptable_obj_change_tol triplet. Default delegates to the scalar Self::current_is_acceptable.
Source§

fn set_curr_acceptable_obj(&mut self, obj: Number)

Record the current objective at the iterate the main loop just stashed as the latest “acceptable point” — mirrors upstream OptimalityErrorConvergenceCheck::SetCurrAcceptableF. The recorded value feeds the acceptable_obj_change_tol stability cross-check on subsequent iterates. Default no-op for policies that don’t track acceptable points.
Source§

impl Default for OptErrorConvCheck

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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, 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