pub struct NlProblem {Show 19 fields
pub n: usize,
pub m: usize,
pub num_obj: usize,
pub minimize: bool,
pub obj_nonlinear: Expr,
pub obj_linear: Vec<(usize, Number)>,
pub obj_constant: Number,
pub con_nonlinear: Vec<Expr>,
pub con_linear: Vec<Vec<(usize, Number)>>,
pub x_l: Vec<Number>,
pub x_u: Vec<Number>,
pub g_l: Vec<Number>,
pub g_u: Vec<Number>,
pub x0: Vec<Number>,
pub lambda0: Vec<Number>,
pub suffixes: NlSuffixes,
pub imported_funcs: Vec<ImportedFunc>,
pub var_names: Vec<String>,
pub con_names: Vec<String>,
}Expand description
Parsed .nl problem in the form needed by NlTnlp.
Fields§
§n: usize§m: usize§num_obj: usize§minimize: bool§obj_nonlinear: Expr§obj_linear: Vec<(usize, Number)>§obj_constant: Number§con_nonlinear: Vec<Expr>Per-constraint nonlinear part (length m).
con_linear: Vec<Vec<(usize, Number)>>Per-constraint linear part (length m), each a list of (var, coef).
x_l: Vec<Number>§x_u: Vec<Number>§g_l: Vec<Number>§g_u: Vec<Number>§x0: Vec<Number>§lambda0: Vec<Number>§suffixes: NlSuffixesAMPL suffix dictionaries. Variable / constraint / objective
suffixes are stored as dense vectors (length n / m / num_obj)
with the sparse .nl S-segment entries scattered in, default
zero. The integer / real split matches the S-segment header’s
kind bit (0x4 ⇒ real, else integer). See
https://ampl.com/REFS/hooking2.pdf §6 and the upstream .nl
reader in ref/Ipopt/src/Apps/AmplSolver/AmplTNLP.cpp.
imported_funcs: Vec<ImportedFunc>AMPL imported (external) functions declared via top-level F segments.
Empty unless the .nl file calls compiled-C user functions (typically
emitted by IDAES property packages — see issue #49).
var_names: Vec<String>Variable names from the sibling .col file, index-aligned to x
(one name per line, column order). Empty when no .col file was
found — AMPL only emits it under option auxfiles rc;.
Carrying names lets diagnostics report flow_balance / T_reactor
instead of c[3] / x[132]. Lee et al. (2024) identify the gap
between detecting an issue and tracing it to a named equation as a
central roadblock for equation-oriented model debugging; threading
names through to the solver/debugger is the prerequisite for closing
it. See https://doi.org/10.69997/sct.147875.
con_names: Vec<String>Constraint names from the sibling .row file, index-aligned to g
(one name per line, row order). Empty when no .row file was found.
See NlProblem::var_names for why names are captured.