#[unsafe(no_mangle)]pub unsafe extern "C" fn GetIpoptCurrentIterate(
ipopt_problem: IpoptProblem,
scaled: Bool,
n: Index,
x: *mut Number,
z_l: *mut Number,
z_u: *mut Number,
m: Index,
g: *mut Number,
lambda: *mut Number,
) -> BoolExpand description
Port of IpStdCInterface.cpp:GetIpoptCurrentIterate (Ipopt 3.14+).
Designed to be called from inside an intermediate callback to
inspect x, the bound multipliers z_L/z_U, the constraint values
g, and the constraint multipliers lambda at the current
iterate.
All output buffers are optional — pass NULL to skip. n and m
must match the dimensions the problem was created with; mismatched
sizes cause the function to return FALSE without writing.
scaled keeps upstream’s meaning (TNLP::get_curr_iterate, Ipopt
3.14 IpTNLP.cpp), on both the interior-point and the active-set SQP
arm:
FALSE— the user TNLP’s unscaled space, the unitsIpoptSolvewrites back: objective, constraint and per-variable (SetIpoptProblemScalingx_scaling) scaling all undone.TRUE— the algorithm’s scaled space in the TNLP’s shape:x̃ = d ⊙ x(a fixed variable at its own value, as upstream’sResortXwrites it),z̃ = obj·z/d(at a fixed variableobj·z,z_L/z_Uswapped whenobj < 0, upstream’s manual rescale ofResortBoundMultipliers),g̃ = s ⊙ g(row factor; equality right-hand sides scaled too) andλ̃ = obj·λ/s(pounce_nlp::live_iterate::scaled_iterate). With presolve on, the scaled values of the problem the algorithm solved, lifted to the user’s shape like the unscaled ones: a column or row the algorithm holds carries its factor, one presolve removed carries factor1(a multiplier there still carriesobj).
Both arms answer from the iterate the algorithm materialises before
each fire (pounce_algorithm::intermediate::UserIterate), built by
the conversions finalize_solution applies — so at the last fire this
reads what IpoptSolve writes back. That includes the bound
multipliers of fixed variables, recovered from ∇f + Jᵀλ as upstream’s
TNLPAdapter::ResortBoundMultipliers does (not under
fixed_variable_treatment=make_parameter_nodual), and, with presolve on,
the rows and columns it removed.
Returns FALSE when called outside an active intermediate
callback (no live iterate to inspect).
§Safety
ipopt_problem must be a valid IpoptProblem. Each output buffer,
when non-NULL, must hold at least the declared length.