pub struct NlpTrace {
pub n_vars: u32,
pub n_constraints: u32,
pub jac_nnz: u32,
pub hess_nnz: u32,
pub status_code: Option<i32>,
pub status_label: Option<String>,
pub iterations: u32,
pub objective: f64,
pub final_primal_inf: Option<f64>,
pub final_dual_inf: Option<f64>,
pub final_mu: Option<f64>,
pub converged: bool,
}Expand description
NLP solver stats for a single NlpSolver::solve call.
Populated by the backend on the returned NlpSolution. Carries both
problem structure (size, sparsity) and termination state (status code
and mnemonic, iteration count, final primal/dual residuals, barrier
parameter). Enables SCUC-equivalent debugging on the AC SCED side —
e.g. distinguishing a proven-infeasible solve from one that hit
max_iter with small residuals.
Fields§
§n_vars: u32Number of decision variables.
n_constraints: u32Number of constraints (rows of g(x)).
jac_nnz: u32Nonzeros in the constraint Jacobian sparsity pattern.
hess_nnz: u32Nonzeros in the Hessian sparsity pattern (0 when Hessian is approximated, e.g. Ipopt L-BFGS mode).
status_code: Option<i32>Raw solver status code (backend-specific). For Ipopt: 0 = Solve_Succeeded, 1 = Solved_To_Acceptable_Level, 2 = Infeasible_Problem_Detected, -1 = Maximum_Iterations_Exceeded, etc.
status_label: Option<String>Human-readable status label (backend mnemonic), e.g.
"Solve_Succeeded", "Restoration_Failed".
iterations: u32Iteration count at termination.
objective: f64Final objective value.
final_primal_inf: Option<f64>Primal infeasibility at the final iterate (max constraint violation in the solver’s scaled internal representation).
final_dual_inf: Option<f64>Dual infeasibility at the final iterate (KKT stationarity residual).
final_mu: Option<f64>Final barrier parameter μ (Ipopt). Large μ at termination
typically indicates the solver stalled before reaching the
interior-point endgame.
converged: boolWhether the solver considered the problem converged.