Skip to main content

ipm_user_iterate

Function ipm_user_iterate 

Source
pub fn ipm_user_iterate(
    nlp: &Rc<RefCell<dyn IpoptNlp>>,
    data: &IpoptDataHandle,
    cq: &IpoptCqHandle,
    fixed_var_duals: bool,
) -> Option<UserIterate>
Expand description

The interior-point iterate in the space of the TNLP the NLP wraps, by the conversions finalize_via_orig_nlp applies to the final one, so the iterate read at the last fire is the solution finalize_solution reports:

  • x through finalize_solution_x (fixed variables spliced back in);
  • z_L, z_U, λ through the finalize_solution_* lifts, which divide out obj_scale_factor (the unscaled-Lagrangian convention);
  • the bound multipliers of variables make_parameter removed recovered from z_L − z_U = ∇f + Jᵀλ when fixed_var_duals — upstream TNLP::get_curr_iterate does the same through TNLPAdapter::ResortBoundMultipliers for every treatment but make_parameter_nodual. Left at 0 they were not a zero multiplier but a missing one;
  • per-variable user-scaling (x̃ = d ⊙ x) is not undone here: the ScalingTnlp that substitutes it undoes it on the iterate’s way through its intermediate_callback, as its finalize_solution does;
  • g from the iterate’s own c / d values, unscaled.

The fixed-variable recovery evaluates the TNLP, so this must run before the callback borrows it, never from inside the callback.