Skip to main content

Module dispatch

Module dispatch 

Source
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:

  1. Classify the parsed problem into a ProblemClass by walking the nonlinear expression trees the .nl reader already produced.
  2. Resolve that class against the user’s solver_selection option into a SolverChoice.
  3. 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§

ProblemClass
The mathematical class of a loaded problem, from most to least specialized. See the module docs and dev-notes/lp-qp-routing.md.
SolverChoice
The resolved solver to dispatch to, after combining a ProblemClass with the solver_selection option.
SolverSelection
Parsed solver_selection option value.

Functions§

classify_problem
Classify a parsed .nl problem.
resolve_solver
Resolve a ProblemClass and a SolverSelection into the solver to dispatch to, or an error string when a forced selection does not match the detected class.