Skip to main content

IpoptCalculatedQuantities

Struct IpoptCalculatedQuantities 

Source
pub struct IpoptCalculatedQuantities {
    pub s_max: Number,
    pub kappa_d: Number,
    /* private fields */
}
Expand description

Calculated-quantities object. Holds shared handles on data and the NLP; per-quantity caches live in RefCells here.

Fields§

§s_max: Number

Optimality scaling cap from IpOptErrorConvCheck defaults.

§kappa_d: Number

Damping coefficient for the bound-multiplier complementarity term (kappa_d in upstream’s RegisterOptions).

Implementations§

Source§

impl IpoptCalculatedQuantities

Source

pub fn new(data: IpoptDataHandle, nlp: Rc<RefCell<dyn IpoptNlp>>) -> Self

Source

pub fn data(&self) -> &IpoptDataHandle

Source

pub fn nlp(&self) -> &Rc<RefCell<dyn IpoptNlp>>

Source

pub fn curr_slack_x_l(&self) -> Rc<dyn Vector>

Source

pub fn curr_slack_x_u(&self) -> Rc<dyn Vector>

Source

pub fn curr_slack_s_l(&self) -> Rc<dyn Vector>

Source

pub fn curr_slack_s_u(&self) -> Rc<dyn Vector>

Source

pub fn trial_slack_x_l(&self) -> Rc<dyn Vector>

Source

pub fn trial_slack_x_u(&self) -> Rc<dyn Vector>

Source

pub fn trial_slack_s_l(&self) -> Rc<dyn Vector>

Source

pub fn trial_slack_s_u(&self) -> Rc<dyn Vector>

Source

pub fn curr_grad_f(&self) -> Rc<dyn Vector>

Source

pub fn trial_grad_f(&self) -> Rc<dyn Vector>

Source

pub fn curr_c(&self) -> Rc<dyn Vector>

Source

pub fn trial_c(&self) -> Rc<dyn Vector>

Source

pub fn curr_d(&self) -> Rc<dyn Vector>

Source

pub fn trial_d(&self) -> Rc<dyn Vector>

Source

pub fn curr_jac_c(&self) -> Rc<dyn Matrix>

Source

pub fn curr_jac_d(&self) -> Rc<dyn Matrix>

Source

pub fn curr_exact_hessian(&self) -> Rc<dyn SymMatrix>

Source

pub fn curr_d_minus_s(&self) -> Rc<dyn Vector>

curr_d - s — port of IpIpoptCalculatedQuantities.cpp:1185-1206.

Source

pub fn trial_d_minus_s(&self) -> Rc<dyn Vector>

Source

pub fn curr_jac_c_t_times_vec(&self, vec: &dyn Vector) -> Rc<dyn Vector>

J_c^T y_c — for a generic vec argument (IpIpoptCalculatedQuantities.cpp:1373-1404).

Source

pub fn curr_jac_d_t_times_vec(&self, vec: &dyn Vector) -> Rc<dyn Vector>

J_d^T y_d for arbitrary vec.

Source

pub fn curr_jac_c_t_times_curr_y_c(&self) -> Rc<dyn Vector>

Source

pub fn curr_jac_d_t_times_curr_y_d(&self) -> Rc<dyn Vector>

Source

pub fn curr_jac_c_times_vec(&self, vec: &dyn Vector) -> Rc<dyn Vector>

J_c vIpIpoptCalculatedQuantities.cpp:1303-1321.

Source

pub fn curr_jac_d_times_vec(&self, vec: &dyn Vector) -> Rc<dyn Vector>

J_d vIpIpoptCalculatedQuantities.cpp:1323-1343.

Source

pub fn curr_grad_lag_x(&self) -> Rc<dyn Vector>

∇_x L = ∇f(x) + J_c^T y_c + J_d^T y_d - P_L z_L + P_U z_U per IpIpoptCalculatedQuantities.cpp:1993-2030.

Source

pub fn curr_grad_lag_s(&self) -> Rc<dyn Vector>

∇_s L = -y_d - P_L v_L + P_U v_U (IpIpoptCalculatedQuantities.cpp:2069-2098).

Source

pub fn curr_compl_x_l(&self) -> Rc<dyn Vector>

Source

pub fn curr_compl_x_u(&self) -> Rc<dyn Vector>

Source

pub fn curr_compl_s_l(&self) -> Rc<dyn Vector>

Source

pub fn curr_compl_s_u(&self) -> Rc<dyn Vector>

Source

pub fn curr_relaxed_compl_x_l(&self) -> Rc<dyn Vector>

s_L .* z_L - mu — relaxed complementarity used in the KKT RHS. IpIpoptCalculatedQuantities.cpp:2406-2430.

Source

pub fn curr_relaxed_compl_x_u(&self) -> Rc<dyn Vector>

Source

pub fn curr_relaxed_compl_s_l(&self) -> Rc<dyn Vector>

Source

pub fn curr_relaxed_compl_s_u(&self) -> Rc<dyn Vector>

Source

pub fn curr_sigma_x(&self) -> Rc<dyn Vector>

Source

pub fn curr_sigma_s(&self) -> Rc<dyn Vector>

Source

pub fn curr_f(&self) -> Number

Source

pub fn unscaled_curr_f(&self) -> Number

Unscaled objective at the current iterate. curr_f returns the internally scaled value (f · df_); upstream IPOPT prints the unscaled objective in its iteration log, so this divides the scaling back out. Mirrors IpoptCalculatedQuantities:: unscaled_curr_f. A zero factor (scaling never determined) is treated as the identity.

Source

pub fn trial_f(&self) -> Number

Source

pub fn curr_barrier_obj(&self) -> Number

Source

pub fn trial_barrier_obj(&self) -> Number

Source

pub fn curr_grad_barrier_obj_x(&self) -> Rc<dyn Vector>

Gradient of the barrier objective wrt x: ∇_x φ = ∇f(x) − μ · [P_L · (1/s_L) − P_U · (1/s_U)] + damping Mirrors IpIpoptCalculatedQuantities.cpp:CalcGradBarrierObjectiveX.

Source

pub fn curr_grad_barrier_obj_s(&self) -> Rc<dyn Vector>

Gradient of the barrier objective wrt s: ∇_s φ = − μ · [P_L · (1/s_s_L) − P_U · (1/s_s_U)] + damping

Source

pub fn curr_grad_barr_t_delta( &self, delta_x: &dyn Vector, delta_s: &dyn Vector, ) -> Number

Directional derivative of the barrier objective along (δx, δs): gradBarrTDelta = ∇_x φ · δx + ∇_s φ · δs. Port of IpIpoptCalculatedQuantities.cpp:CurrGradBarrTDelta (called IpCq().curr_gradBarrTDelta() in upstream after the search dir has been computed).

Source

pub fn curr_dwd(&self, delta_x: &dyn Vector, delta_s: &dyn Vector) -> Number

δᵀ(W + Σ_x + δ_pert_x I)δ_x + δ_sᵀ(Σ_s + δ_pert_s I)δ_s — the quadratic-model term used by IpPenaltyLSAcceptor.cpp: InitThisLineSearch:101-129. Reads W and the active PD perturbations from crate::ipopt_data::IpoptData. Returns 0 if the result would be negative (matching upstream’s if dWd <= 0 then dWd = 0 guard at line 133).

Source

pub fn curr_constraint_violation(&self) -> Number

Source

pub fn trial_constraint_violation(&self) -> Number

Source

pub fn curr_primal_infeasibility_max(&self) -> Number

Max-norm primal infeasibility — max(||c||_∞, ||d − s||_∞). Used by the iteration output’s inf_pr column when inf_pr_output == INTERNAL. Mirrors IpIpoptCalculatedQuantities.cpp:CurrPrimalInfeasibility(NORM_MAX).

Source

pub fn curr_dual_infeasibility_max(&self) -> Number

Max-norm dual infeasibility — max(||∇_x L||_∞, ||∇_s L||_∞). Mirrors IpIpoptCalculatedQuantities.cpp:CurrDualInfeasibility(NORM_MAX).

Source

pub fn curr_infeasibility_stationarity(&self) -> Number

Scaled stationarity of the infeasibility measure ½‖(c, d−s)‖²‖J_cᵀ c + J_dᵀ (d−s)‖_∞ / max(1, ‖(c, d−s)‖_∞). The numerator is the x-gradient of the squared constraint violation; a value near zero with the violation itself bounded away from zero marks an iterate converging to a stationary point of the infeasibility — i.e. a locally infeasible problem. No linear solve: two transpose-products. Mirrors the gradient term behind Ipopt’s IpRestoConvCheck.cpp LOCALLY_INFEASIBLE test, applied here in the main loop.

Source

pub fn curr_avrg_compl(&self) -> Number

(z_L · s_L + z_U · s_U + v_L · s_L^d + v_U · s_U^d) / N where N is the total number of bound multipliers (IpIpoptCalculatedQuantities.cpp:3553-3606).

Source

pub fn curr_complementarity_min(&self) -> Number

min_i (s_i · z_i) over all four bound complementarity blocks. Mirrors IpIpoptCalculatedQuantities.cpp:CurrComplxMin (lines 3608-3640) — the smallest pairwise product s · z, signalling how close the iterate is to the central path. Empty bound sets contribute +∞; returns 0 if no bounds at all.

Source

pub fn curr_complementarity_max(&self) -> Number

Max-norm of the unbarriered complementarity blocks max_i |s_i · z_i| across all four (x_L, x_U, s_L, s_U) pairs. Mirrors upstream IpIpoptCalculatedQuantities.cpp:CurrComplementarity(0., NORM_MAX) — used by OptimalityErrorConvergenceCheck to gate the per-component compl_inf_tol test independently of the scaled scalar curr_nlp_error.

Source

pub fn curr_centrality_measure(&self) -> Number

Centrality measure ξ = min_i(s_i z_i) / avrg(s · z). Mirrors IpIpoptCalculatedQuantities.cpp:CurrCentralityMeasure. Used by crate::mu::oracle::loqo::LoqoMuOracle to bias σ toward the central path when the iterate is unbalanced. Returns 1.0 (perfectly central) when there are no bound multipliers.

Source

pub fn curr_barrier_error(&self) -> Number

Barriered KKT error E_μ(x,y,z) — port of IpIpoptCalculatedQuantities.cpp:CurrBarrierError. Same as Self::curr_nlp_error but uses the relaxed complementarity s ⊙ z − μ so the residual is zero when the iterate sits on the μ-perturbed central path. The monotone barrier-update strategy reduces μ only once this error drops below barrier_tol_factor · μ.

Source

pub fn curr_nlp_error(&self) -> Number

Optimality-scaled max-norm KKT error — port of IpIpoptCalculatedQuantities.cpp:3050-3104.

  E = max( ||∇_x L, ∇_s L||_∞ / s_d ,
           ||c, d − s||_∞ ,
           ||compl||_∞ / s_c )

where s_d / s_c are the asum-based scalings from ComputeOptimalityErrorScaling (see §4 of MAIN_LOOP.md). Uses mu_target = 0 (the unbarriered KKT residual). The barriered variant is curr_barrier_error (TODO in Phase 7).

Source

pub fn trial_jac_c(&self) -> Rc<dyn Matrix>

Source

pub fn trial_jac_d(&self) -> Rc<dyn Matrix>

Source

pub fn trial_grad_lag_x(&self) -> Rc<dyn Vector>

∇_x L at the trial iterate — analog of Self::curr_grad_lag_x.

Source

pub fn trial_grad_lag_s(&self) -> Rc<dyn Vector>

∇_s L at the trial iterate — analog of Self::curr_grad_lag_s.

Source

pub fn trial_compl_x_l(&self) -> Rc<dyn Vector>

Source

pub fn trial_compl_x_u(&self) -> Rc<dyn Vector>

Source

pub fn trial_compl_s_l(&self) -> Rc<dyn Vector>

Source

pub fn trial_compl_s_u(&self) -> Rc<dyn Vector>

Source

pub fn curr_primal_dual_system_error(&self, mu: Number) -> Number

Unscaled primal-dual KKT system error at the current iterate — port of IpIpoptCalculatedQuantities.cpp:curr_primal_dual_system_error. Each block uses the 1-norm scaled by its entry count; the result is the sum of the dual-infeasibility, primal-infeasibility, and complementarity terms. Used by the soft restoration phase’s sufficient-reduction test.

Source

pub fn trial_primal_dual_system_error(&self, mu: Number) -> Number

Unscaled primal-dual KKT system error at the trial iterate — trial-side analog of Self::curr_primal_dual_system_error.

Source

pub fn curr_grad_lag_with_damping_x(&self) -> Rc<dyn Vector>

curr_grad_lag_x plus the kappa_d · μ · (Px_L · 1 − Px_U · 1) damping term on singly-bounded primals — port of IpIpoptCalculatedQuantities.cpp:2131-2180. When kappa_d == 0 returns the un-damped gradient.

Source

pub fn curr_grad_lag_with_damping_s(&self) -> Rc<dyn Vector>

Source

pub fn grad_kappa_times_damping_x(&self) -> Rc<dyn Vector>

kappa_d · (P_L · damping_l − P_U · damping_u) in the full x space — port of IpIpoptCalculatedQuantities.cpp::grad_kappa_times_damping_x (lines 912-949). Unlike curr_grad_lag_with_damping_x this does NOT include grad_lag_x and is NOT scaled by mu; the centering RHS in the quality-function oracle multiplies the returned vector by -avrg_compl per upstream IpQualityFunctionMuOracle.cpp:229.

Source

pub fn grad_kappa_times_damping_s(&self) -> Rc<dyn Vector>

Source

pub fn aff_step_alpha_primal_max( &self, delta_aff: &IteratesVector, tau: Number, ) -> Number

Max primal step that keeps s + α · Δs > 0 for the four slack blocks (x_L, x_U, s_L, s_U), bounded by the fraction-to-the- boundary parameter τ ∈ (0, 1]. Mirrors CalcFracToBound against the projected step P_L^T Δx, −P_U^T Δx, P_L^T Δs, −P_U^T Δs.

Source

pub fn aff_step_alpha_dual_max( &self, delta_aff: &IteratesVector, tau: Number, ) -> Number

Max dual step that keeps z + α · Δz > 0 (and same for v).

Source

pub fn aff_step_compl_avrg( &self, delta_aff: &IteratesVector, alpha_primal: Number, alpha_dual: Number, ) -> Number

Predicted average complementarity after the affine step: (1/N) · Σ (s + α_pri · Δs) · (z + α_du · Δz) summed over the four bound blocks. Returns 0 when there are no bounds.

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