Expand description
Ipopt-style console printers (banner, problem statistics, end-of-run
summary). The single source of truth for the text log: the algorithm’s
output layer emits these gated on print_level, and the CLI reuses the
banner. Moved out of pounce-cli so pounce-algorithm can emit them
natively (#206).
Ipopt-style banner / problem-stats / final-summary printing,
shared by the pounce CLI (which re-exports this module as
print) and the Python bindings (pounce.print_banner,
Problem.print_problem_stats, Solver.print_summary). Output is
structured to match upstream Ipopt’s console layout closely enough
that anyone familiar with ipopt can spot at a glance whether
POUNCE is converging similarly.
Structs§
- Eval
Counts - Evaluation-callback tallies for the end-of-run summary, decoupled
from any particular TNLP wrapper so both the CLI’s
CountingTnlpand the Python bindings’ callback problem can supply them. - Problem
Stats
Functions§
- collect_
stats - Gather everything the banner block needs, reported over the reduced
problem that the algorithm actually solves — i.e. after
fixed_variable_treatmentremoves fixed (x_l == x_u) variables undermake_parameter. This mirrors Ipopt, whose banner is computed from the post-IpTNLPAdapterproblem; computing it from the raw TNLP instead made pounce over-report variables and bucket fixed vars as “lower and upper bounds” (#140). - fmt_
ipopt - Format a number in Ipopt’s scientific notation: 16-digit mantissa,
signed 2-digit exponent (e.g.
3.7952009505566139e+03). Rust’s{:.16e}is close but emits a 1-digit exponent without leading sign, which makes side-by-side diffs againstipoptoutput messy. - logo_
rows - Render the POUNCE wordmark as styled rows (one
Stringper line): steel-sheen letters with three molten claw slashes, in the project palette. Emits ANSI styling only whencolor; otherwise plain#//block characters. Shared by the solve header (print_logo) and the interactive debugger’s open banner (rendered to stderr). - print_
banner - print_
convex_ summary - Emit an Ipopt-style end-of-run summary for the dedicated convex
(LP / QP / conic) IPM path. That path otherwise prints only a compact
one-line result, so the
Number of Iterations....:andObjective...............:lines the general NLP path emits are missing. Downstream consumers that parse Ipopt’s summary block — notably the benchmark harness’sextract_obj/extract_itersinbenchmarks/scripts/run_nl_bench.sh— then see a null objective and zero iterations even though the solve succeeded. This prints the same labelled lines (objective + KKT residual rows) so those consumers capture the real values. The convex solver reports a single (unscaled, user-sense) objective and residuals, so the “(scaled)”/“(unscaled)” columns carry the same value. - print_
logo - Print the branded POUNCE ASCII wordmark, mimicking the project logo.
- print_
problem_ stats - print_
summary - status_
message