Skip to main content

Module check_x0

Module check_x0 

Source
Expand description

pounce check-x0 <problem.nl> — starting-point preflight.

§Why this exists

A local NLP solver’s fate is largely decided at iteration 0, but the solver only reports starting-point trouble after it has tripped over it (Invalid_Number_Detected mid-solve, immediate restoration, a slow crawl caused by scaling). This subcommand evaluates the model once at its starting point, before any solve, and reports what the initializer and the first iteration will actually see:

  • Non-finite evaluations — NaN/inf in f, ∇f, g, the Jacobian, or the Hessian at x0. These are fatal: the solve would abort.
  • Bound violations of x0 and components sitting exactly on a bound (the interior clamp will move both; see below).
  • Interior-clamp displacement — the bound_push / bound_frac clamp (DefaultIterateInitializer) applied to x0, so “the solver silently moved my point” is visible up front.
  • Initial constraint violation per row (infeasibility is fine for the IPM, but very large violations usually mean a wrong or missing starting point).
  • Derivative scale spread — max/min nonzero magnitudes of ∇f and the Jacobian at x0, the early-warning signal for scaling trouble.

The checks are read-only and cost one evaluation of each callback: O(nnz) work, no factorization, no solve.

Verdict / exit code: 0 when the model evaluates cleanly at x0 (warnings allowed); 21 when an evaluation produced NaN/inf (the solver would fail); 2 on a usage or I/O error.

User-facing background: docs/src/initialization.md.

Structs§

CheckX0Args
Parsed check-x0 subcommand arguments.
CheckX0Outcome
The fully-evaluated preflight result.
ClampMove
One interior-clamp displacement entry.
NonFinite
One non-finite evaluation entry.
NonFiniteEntry
One Jacobian/Hessian non-finite entry (row/col in matrix coordinates).
ScaleSpread
Max/min-nonzero magnitude summary of a derivative array at x0.

Functions§

check_tnlp
The core preflight over any TNLP. Public so the debugger / tests can reuse it without going through a file.
clamp_to_interior
The per-component interior clamp from DefaultIterateInitializer::push_to_interior (see crates/pounce-algorithm/src/init/default.rs and docs/src/initialization.md).
run
run_from_argv
Entry point dispatched from main when argv[1] == “check-x0”.