Expand description
Session-style C ABI built on pounce_sensitivity::Solver.
Adds an opaque IpoptSolver handle that captures the converged
KKT factor between calls, so C consumers can issue many cheap
operations (KKT back-solves, parametric steps, reduced Hessians)
against the same factorization without re-running the IPM.
IpoptProblem prob = CreateIpoptProblem(...);
AddIpoptStrOption(prob, "linear_solver", "feral");
IpoptSolver sol = IpoptCreateSolver(&prob); // consumes prob
IpoptSolverSolve(sol, x, NULL, NULL, NULL, NULL, NULL, user_data);
IpoptSolverParametricStep(sol, 2, pin_indices, deltas, dx_out);
IpoptSolverReducedHessian(sol, 2, pin_indices, 1.0, hr_out);
IpoptFreeSolver(sol);Ownership: IpoptCreateSolver takes the IpoptProblem by pointer
to the handle and nulls it out on success — the IpoptSolver
becomes the sole owner. Calling crate::FreeIpoptProblem on the
now-null handle is safe (it null-checks).
Structs§
- Ipopt
Solver Info - Internal owned state for the session-style C handle.
Functions§
- Ipopt
Create ⚠Solver - Build an
IpoptSolversession from a configuredIpoptProblem. Consumes the IpoptProblem on success: the pointer at*prob_handleis set to NULL and ownership transfers to the returned IpoptSolver. The user should not use the original handle again, though callingcrate::FreeIpoptProblemon the now-null pointer is harmless (it null-checks). - Ipopt
Free ⚠Solver - Release an
IpoptSolverand all owned resources, including the IpoptProblem state that was consumed byIpoptCreateSolver. - Ipopt
Solver ⚠GetKkt Dim - Total compound-KKT vector dimension. Returns -1 if no converged factor is held.
- Ipopt
Solver ⚠KktSolve - Solve
K · lhs = rhsagainst the converged KKT factor. Bothrhsandlhsare flat buffers of lengthIpoptSolverGetKktDimin thex || s || y_c || y_d || z_l || z_u || v_l || v_upacking. - Ipopt
Solver ⚠Parametric Step - First-order parametric step
Δx ≈ ∂x*/∂p · Δp.pin_indicesisn_pinsIndexvalues (0-based indices intog(x));deltasis the parameter perturbationΔpof the same length;dx_outis then-long primal step output (length matches the problem’sn). - Ipopt
Solver ⚠Reduced Hessian - Reduced Hessian
H_R = obj_scal · B K⁻¹ Bᵀover the pinned rows.hr_outreceives ann_pins²-long column-major dense matrix. - Ipopt
Solver ⚠Solve - Run the IPM. Same output buffer contract as
crate::IpoptSolve:xis in/out (initial guess in, solution out);g,obj_val,mult_g,mult_x_L,mult_x_Uare out-only and may be NULL.user_datais threaded into the C callbacks unchanged.
Type Aliases§
- Ipopt
Solver - Opaque session-style handle. Construction via
IpoptCreateSolver; release viaIpoptFreeSolver.