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, f64)>,
pub obj_constant: f64,
pub con_nonlinear: Vec<Expr>,
pub con_linear: Vec<Vec<(usize, f64)>>,
pub x_l: Vec<f64>,
pub x_u: Vec<f64>,
pub g_l: Vec<f64>,
pub g_u: Vec<f64>,
pub x0: Vec<f64>,
pub lambda0: Vec<f64>,
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, f64)>§obj_constant: f64§con_nonlinear: Vec<Expr>Per-constraint nonlinear part (length m).
con_linear: Vec<Vec<(usize, f64)>>Per-constraint linear part (length m), each a list of (var, coef).
x_l: Vec<f64>§x_u: Vec<f64>§g_l: Vec<f64>§g_u: Vec<f64>§x0: Vec<f64>§lambda0: Vec<f64>§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.
Trait Implementations§
Auto Trait Implementations§
impl !Send for NlProblem
impl !Sync for NlProblem
impl Freeze for NlProblem
impl RefUnwindSafe for NlProblem
impl Unpin for NlProblem
impl UnsafeUnpin for NlProblem
impl UnwindSafe for NlProblem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more