Skip to main content

OptErrorConvCheck

Struct OptErrorConvCheck 

Source
pub struct OptErrorConvCheck {
Show 19 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,
}

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.

Implementations§

Trait Implementations§

Source§

impl ConvCheck for OptErrorConvCheck

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

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.
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 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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