pub trait ConvCheck {
// Required method
fn check_convergence(
&mut self,
nlp_err: Number,
iter_count: Index,
) -> ConvergenceStatus;
// Provided methods
fn check_convergence_with_state(
&mut self,
nlp_err: Number,
iter_count: Index,
_data: &IpoptDataHandle,
_cq: &IpoptCqHandle,
) -> ConvergenceStatus { ... }
fn current_is_acceptable(&self, _nlp_err: Number) -> bool { ... }
fn current_is_acceptable_with_state(
&self,
nlp_err: Number,
_data: &IpoptDataHandle,
_cq: &IpoptCqHandle,
) -> bool { ... }
fn set_curr_acceptable_obj(&mut self, _obj: Number) { ... }
fn tol_or_default(&self) -> Number { ... }
}Required Methods§
fn check_convergence( &mut self, nlp_err: Number, iter_count: Index, ) -> ConvergenceStatus
Provided Methods§
Sourcefn check_convergence_with_state(
&mut self,
nlp_err: Number,
iter_count: Index,
_data: &IpoptDataHandle,
_cq: &IpoptCqHandle,
) -> ConvergenceStatus
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.
Sourcefn current_is_acceptable(&self, _nlp_err: Number) -> bool
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.
Sourcefn current_is_acceptable_with_state(
&self,
nlp_err: Number,
_data: &IpoptDataHandle,
_cq: &IpoptCqHandle,
) -> bool
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.
Sourcefn set_curr_acceptable_obj(&mut self, _obj: Number)
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.
Sourcefn tol_or_default(&self) -> Number
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".