Expand description
Extract a pounce_convex::QpProblem (standard form) from a parsed
.nl problem, for the LP/QP dispatch path (Phase 2).
The classifier (crate::dispatch) has already decided the problem is
an LP or convex QP; this module marshals the parsed NlProblem into
the standard form the convex IPM consumes:
minimize ½ xᵀP x + cᵀx
subject to A x = b (equalities)
G x ≤ h (inequalities, incl. finite var bounds)Mapping from the .nl representation:
- Objective.
Pis the Hessian of the (degree-≤2) objective — recovered with the sameanalyze_quadraticthe classifier uses, soPhere is exactly the matrix whose definiteness was tested.cis the objective’s linear part. Amaximizeobjective is negated into a minimization. - Constraints. Each row has a linear part and bounds
g_l ≤ row ≤ g_u. An equality (g_l == g_u) becomes a row ofA; a one- or two-sided inequality becomes one or two rows ofG(row ≤ g_uand/or−row ≤ −g_l). - Variable bounds. Finite
x_l/x_ubecomeGrows (−x_i ≤ −x_l,x_i ≤ x_u); the.nl“infinity” sentinel (|v| ≥ 1e19) is treated as no bound.
Enums§
- ConRow
Map - Where each
.nlconstraint’s rows landed in the standard-form QP, so the QP’s multipliers can be mapped back to a per-.nl-constraint dual for the.sol. One entry per original constraint, in order. - ConSocp
Map - Where each
.nlconstraint landed in the standard-form conic program, so the cone multipliers can be mapped back to a per-.nl-constraint dual. One entry per original constraint, in order. (Analogue ofConRowMapfor the SOCP path produced byextract_socp_with_map.)
Functions§
- extract_
qp - Convert a classified LP/convex-QP
NlProblemintoQpProblemstandard form. ReturnsNoneif the objective is not actually a degree-≤2 polynomial (should not happen for a problem the classifier routed here, but the conversion is total and falls back gracefully). - extract_
qp_ with_ map - Extract the QP, the constraint→row provenance map, and the objective constant folded into the nonlinear tree (see below), together.
- extract_
socp_ with_ map - Convert a classified convex QCQP
NlProbleminto the conic standard form the SOCP IPM consumes: - recover_
duals - Map the QP solver’s multipliers
(y, z)back to a per-.nl- constraint dual vector (lengthprob.m), in the AMPL.solconvention used by POUNCE’s NLP path. - recover_
socp_ duals - Map the SOCP solver’s multipliers
(y, z)back to a per-.nl-constraint dual vector (lengthprob.m), in POUNCE’s NLP-path.solconvention.