pympcc.frontend.ampl.from_nl

pympcc.frontend.ampl.from_nl(path)[source]

Read an AMPL text-format .nl file and return an pympcc.MPCCProblem.

Complementarity constraints (encoded via bound-type-5 entries in the b segment) are routed into the MCP bulk form (comp_var_pairs_bulk). Remaining constraints are split between equality and inequality blocks based on the AMPL bound type codes in the r segment.

Not supported:

  • Binary .nl files (rejected with NLParseError).

  • Defined variables (V segments) and logical constraints (L).

  • Imported function calls (f<N>).

  • Multiple objectives — only objective 0 is honoured; the rest are ignored with a UserWarning.

Return type:

Any

Parameters:

path (str | Path)