pub struct OptErrorConvCheck {Show 32 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 primal_noise_floor_kappa: Number,
pub acceptable_progress_kappa: Number,
pub acceptable_window: VecDeque<(Number, Number)>,
pub acceptable_progress_refusals: Index,
pub dual_inf_scale_kappa: Number,
pub dual_floor_reported: bool,
pub veto_fired: bool,
pub acceptable_veto_fired: bool,
pub masked_acceptable_veto_fired: bool,
pub veto_extra_iters: Index,
pub rel_infeas_extra_iters: Index,
pub prev_rel_viol: Number,
}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: NumberTolerance 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: NumberMultiple 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. Floored
at [MIN_INFEAS_VIOL_FLOOR]; see
OptErrorConvCheck::absolute_viol_threshold.
infeas_max_streak: IndexConsecutive infeasible-stationary iterations required before
terminating with LocallyInfeasible. Non-positive disables
rapid infeasibility detection.
infeas_streak: IndexRunning count of consecutive infeasible-stationary iterations.
obj_scale_certificate_threshold: NumberObjective-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.
primal_noise_floor_kappa: NumberSafety factor on the per-row noise floor the strict gate judges the
primal term against (gh #528). 0 disables the floor entirely,
restoring upstream Ipopt’s bare-absolute primal residual.
acceptable_progress_kappa: NumberFraction of acceptable_tol the KKT error — and, relative to the
objective’s own size, the objective — may drift across the
acceptable-level streak’s window while the streak still counts as
settled (gh #533). See Self::streak_has_flattened. 0 disables
the progress test, leaving acceptable-level termination the bare
consecutive-count criterion upstream Ipopt uses.
acceptable_window: VecDeque<(Number, Number)>Trailing (nlp_err, f) samples of the current acceptable-level streak,
oldest first, at most Self::progress_window_len entries. Cleared
whenever the streak breaks — the window describes this streak.
acceptable_progress_refusals: IndexAcceptable-level terminations the gh #533 progress test has refused so
far this solve. Bounded by [ACCEPTABLE_PROGRESS_MAX_REFUSALS], past
which the test stands aside and the streak terminates as it would
without it.
dual_inf_scale_kappa: NumberSafety factor on the scale-relative floor the strict gate judges
dual_inf against (gh #532); see Self::dual_inf_bound. 0 disables
the floor, restoring upstream Ipopt’s bare-absolute dual_inf_tol.
dual_floor_reported: boolWhether the gh #532 scale-relative dual floor has already been reported
this solve. Diagnostic only — the certificate below carries a dual
infeasibility above dual_inf_tol, which is worth saying once and not
once per iteration.
veto_fired: boolWhether a masked strict certificate was ever refused this solve.
acceptable_veto_fired: boolWhether 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.
Set by both refusal arms — the gh #200 masked-scale veto and the
gh #533 progress test — because both need the same undo. What the
masked veto’s own iteration budget counts is
Self::masked_acceptable_veto_fired.
masked_acceptable_veto_fired: boolWhether the masked-scale (gh #200) arm specifically refused an acceptable-level termination.
[VETO_MAX_EXTRA_ITERS] is the masked veto’s budget, so only the masked
arms may spend it. Counting the gh #533 progress refusals against it too
would silently disarm the masked veto 60 iterations into any solve whose
acceptable streak was progress-refused — a different mechanism’s bug
coming back for reasons having nothing to do with objective scaling.
veto_extra_iters: IndexIterations 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.
rel_infeas_extra_iters: IndexIterations on which the scale-relative feasibility veto blocked a
certificate (strict or acceptable) that the absolute tolerances had
passed. Bounded by [VETO_MAX_EXTRA_ITERS]; past the budget the veto
disengages and the run terminates as it would have without it, so the
worst case is a bounded number of extra iterations, never a lost
verdict. See Self::relative_viol_threshold.
prev_rel_viol: NumberRelative primal infeasibility at the previous
Self::note_infeasible_stationary call — the progress signal for the
relative arm’s streak (see that method). NAN until first set, which
compares as “not improving” and lets the first iterate count.
Implementations§
Trait Implementations§
Source§impl ConvCheck for OptErrorConvCheck
impl ConvCheck for OptErrorConvCheck
Source§fn certificate_vetoed(&self) -> bool
fn certificate_vetoed(&self) -> bool
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 moreSource§fn acceptable_certificate_vetoed(&self) -> bool
fn acceptable_certificate_vetoed(&self) -> bool
OptErrorConvCheck::acceptable_veto_fired.fn check_convergence( &mut self, nlp_err: Number, iter_count: Index, ) -> ConvergenceStatus
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
fn current_passes_strict( &self, nlp_err: Number, _data: &IpoptDataHandle, cq: &IpoptCqHandle, ) -> bool
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 moreSource§fn tol_or_default(&self) -> Number
fn tol_or_default(&self) -> Number
IpBacktrackingLineSearch.cpp:580). Default 1e-8 matches
upstream’s default tol.Source§fn constr_viol_tol_or_default(&self) -> Number
fn constr_viol_tol_or_default(&self) -> Number
constr_viol_tol, in the unscaled max-norm
space curr_unscaled_primal_infeasibility_max reports — the option that
declares what a violated constraint is. Read moreSource§fn acceptable_constr_viol_tol_or_default(&self) -> Number
fn acceptable_constr_viol_tol_or_default(&self) -> Number
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
fn set_tolerance(&mut self, name: &str, value: Number) -> bool
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
fn current_is_acceptable(&self, nlp_err: Number) -> bool
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
fn current_is_acceptable_with_state( &self, nlp_err: Number, _data: &IpoptDataHandle, cq: &IpoptCqHandle, ) -> bool
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)
fn set_curr_acceptable_obj(&mut self, obj: Number)
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.Auto Trait Implementations§
impl Freeze for OptErrorConvCheck
impl RefUnwindSafe for OptErrorConvCheck
impl Send for OptErrorConvCheck
impl Sync for OptErrorConvCheck
impl Unpin for OptErrorConvCheck
impl UnsafeUnpin for OptErrorConvCheck
impl UnwindSafe for OptErrorConvCheck
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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