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_fracclamp (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
∇fand the Jacobian at x0, the early-warning signal for scaling trouble. - Automatic scaling — the objective and per-row factors
nlp_scaling_method=gradient-based(the default) will pick at this x0, computed by the solver’s own arithmetic; plus, for a.nlmodel, the coefficient magnitudes of its quadratic rows, which that sample cannot report. SeeScalingPreview.
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§
- Check
X0Args - Parsed
check-x0subcommand arguments. - Check
X0Outcome - The fully-evaluated preflight result.
- Clamp
Move - One interior-clamp displacement entry.
- NonFinite
- One non-finite evaluation entry.
- NonFinite
Entry - One Jacobian/Hessian non-finite entry (row/col in matrix coordinates).
- Quad
RowCoef - Point-free coefficient magnitudes of one quadratic constraint row.
- Quad
RowScale - The coefficient magnitudes of one quadratic constraint row, read off
the
.nlwithout reference to any point, paired with what the gradient sample at x0 made of it. - RowScale
Block - One row block’s share of the gradient-based scaling preview.
- Scale
Spread - Max/min-nonzero magnitude summary of a derivative array at x0.
- Scaling
Preview - What
nlp_scaling_method=gradient-basedwill do to this model at this x0 — the solver’s own arithmetic (gradient_obj_scale/gradient_row_scale), not a copy of it.
Constants§
- NLP_
SCALING_ MAX_ GRADIENT nlp_scaling_max_gradient’s default — the cutoff above which gradient-based scaling fires. Overridable with--scaling-max-gradientso a preflight can preview the same cutoff the solve will run under.- NLP_
SCALING_ MIN_ VALUE nlp_scaling_min_value’s default — the floor on a computed scale.
Functions§
- check_
tnlp - The core preflight over any TNLP. Public so the debugger / tests can reuse it without going through a file.
- check_
tnlp_ with_ quadratics check_tnlpplus the quadratic-row coefficients read off the model’s.nl(seequad_row_coefs), which is the half of the scaling report no evaluation at x0 can produce.- clamp_
to_ interior - The per-component interior clamp from
DefaultIterateInitializer::push_to_interior(seecrates/pounce-algorithm/src/init/default.rsanddocs/src/initialization.md). - quad_
row_ coefs - Read every constraint row’s quadratic coefficients out of an
NlProblem. - run
- run_
from_ argv - Entry point dispatched from
mainwhen argv[1] == “check-x0”.