Skip to content

Commit

Permalink
MP2NL: 'nonlinear' vars #237
Browse files Browse the repository at this point in the history
  • Loading branch information
glebbelov committed Nov 12, 2024
1 parent a9cee98 commit a7bc189
Show file tree
Hide file tree
Showing 4 changed files with 402 additions and 177 deletions.
2 changes: 1 addition & 1 deletion include/mp/flat/nl_expr/constr_nl.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class NLBaseAssign
/// Imitate
double coef(int i) const { assert(!i); return -1.0; }
/// Imitate
double var(int i) const { assert(!i); return GetVar(); }
int var(int i) const { assert(!i); return GetVar(); }

/// Throw - should not be used
VarArray1 GetArguments() const { MP_RAISE("No marking for NL items"); }
Expand Down
3 changes: 2 additions & 1 deletion include/mp/nl-reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -2131,7 +2131,8 @@ class NLProblemBuilder {
/// Add variables
void AddVariables(const NLHeader& h) {
// Distinguish NL variable order
// See D.M.Gay, Hooking Your Solver to AMPL; and Writing .NL Files,
// See D.M.Gay, Hooking Your Solver to AMPL;
// D.M.Gay, Writing .NL Files;
// and, e.g.,
// github.com/jump-dev/MathOptInterface.jl/blob/master/src/FileFormats/NL/README.md
int k=0; // current block position
Expand Down
Loading

0 comments on commit a7bc189

Please sign in to comment.