Expand description
Solver routing for the LP/QP/QCQP dispatch.
See dev-notes/lp-qp-routing.md. This module sits between problem
loading and the call to optimize_tnlp. It does three things:
- Classify the parsed problem into a
ProblemClassby walking the nonlinear expression trees the.nlreader already produced. - Resolve that class against the user’s
solver_selectionoption into aSolverChoice. - Dispatch to the chosen solver (in
main.rs).
All solvers are wired: auto routes an LP/convex-QP to pounce-convex’s
interior-point solver, a convex QCQP to the same crate’s conic (SOCP)
driver, and everything else to the existing filter-IPM (Nlp).
§Classification
The .nl format has no dedicated quadratic section: each row’s
linear part lives in the G/J coefficient segments (already split
out into NlProblem::obj_linear / NlProblem::con_linear),
while any higher-order term — including a QP’s quadratic terms — is
written into the nonlinear expression tree as Mul/Pow nodes. So:
- no nonlinear parts at all → LP;
- all nonlinear parts are degree-2 polynomials → QP family (convex / nonconvex / QCQP split by curvature);
- anything else (transcendental, higher degree) → NLP.
§Conservative fallback (correctness guard)
Misclassifying an indefinite or non-quadratic problem into a convex
solver would return a spurious KKT point as if globally optimal.
Whenever the walk cannot prove the stronger class, the classifier
falls back to the more general one, ultimately Nlp. The convexity
(PSD) test uses a tolerance and routes “inconclusive within
tolerance” to the safe side, never to the convex path.
Enums§
- Problem
Class - The mathematical class of a loaded problem, from most to least
specialized. See the module docs and
dev-notes/lp-qp-routing.md. - Solver
Choice - The resolved solver to dispatch to, after combining a
ProblemClasswith thesolver_selectionoption. - Solver
Selection - Parsed
solver_selectionoption value.
Functions§
- classify_
problem - Classify a parsed
.nlproblem. - resolve_
solver - Resolve a
ProblemClassand aSolverSelectioninto the solver to dispatch to, or an error string when a forced selection does not match the detected class.