Skip to main content

Module ipopt_cq

Module ipopt_cq 

Source
Expand description

Lazy-cache layer — port of Algorithm/IpIpoptCalculatedQuantities.{hpp,cpp}.

Upstream’s CQ object exposes ~80 cached quantities (curr_f, curr_grad_f, curr_jac_c, curr_grad_lag_x, curr_compl_*, curr_nlp_error, etc.). All of them are pure derivations from (x, s, y_c, y_d, z_l, z_u, v_l, v_u) and the NLP function evaluations.

Phase 5 ships the priority subset needed by the KKT layer (Phase 6) and the convergence check / line search (Phase 7). Caching is intentionally deferred — every accessor recomputes its value on each call. Tag-based invalidation lands once the inner loop benchmarks justify the bookkeeping; correctness does not depend on it.

All accessors take &self and return Rc<dyn Vector>. NLP evaluations require a brief borrow_mut() on the Nlp handle; callers must not hold an outstanding borrow() across an accessor call.

Structs§

AdjustedBounds
Result of IpoptCalculatedQuantities::adjusted_trial_bounds: the new x_L / x_U / d_L / d_U to install on the NLP when one or more trial slacks were corrected by the safe-slack mechanism.
IpoptCalculatedQuantities
Calculated-quantities object. Holds shared handles on data and the NLP; per-quantity caches live in RefCells here.

Functions§

unscaled_block_amax
Max-norm of v after dividing each entry by its per-row scale factor (max_i |v_i / scale_i|). scale == None means “no row scaling” and returns the plain v.amax(); a zero factor for an entry is treated as the identity (no divide) so a degenerate scale never yields infinities. Falls back to v.amax() for a non-dense backing — POUNCE is dense-only, so that branch is defensive.

Type Aliases§

IpoptCqHandle
Convenience handle. Mirrors upstream’s SmartPtr<CQ> flow.